-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor code improvements #1622
Minor code improvements #1622
Conversation
9011752
to
363c910
Compare
@@ -153,7 +153,7 @@ - (NSString *)description { | |||
[desc appendFormat:@"<ASTextLine: %p> row:%ld range:%tu,%tu", self, (long)self.row, range.location, range.length]; | |||
[desc appendFormat:@" position:%@",NSStringFromCGPoint(self.position)]; | |||
[desc appendFormat:@" bounds:%@",NSStringFromCGRect(self.bounds)]; | |||
return desc; | |||
return [desc copy]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it is absolutely correct to return an immutable copy, it might not matter in this case since desc
is going to be thrown away when this method returns anyways (i.e it can be modified by the caller without affecting anything)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. The commit targets for this purpose is deleted from the PR, and the PR message is also updated :)
@@ -440,7 +440,7 @@ - (NSString *)as_plainTextForRange:(NSRange)range { | |||
[result appendString:[string substringWithRange:range]]; | |||
} | |||
}]; | |||
return result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, changing result
later on doesn't affect anything?
@@ -106,7 +106,7 @@ + (NSParagraphStyle *)as_styleWithCTStyle:(CTParagraphStyleRef)CTStyle { | |||
style.defaultTabInterval = defaultTabInterval; | |||
} | |||
|
|||
return style; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
Also, can you please rebase with master so this PR will be tested by our new CI? Thanks. |
363c910
to
6f4042a
Compare
The PR is rebased with the latest |
I guess that is because the PR is from my fork, and I'm not in the |
Ah, that's right. I've re-enabled the old CI for PRs like yours. Here is the official doc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
6f4042a
to
9ae3ade
Compare
Work like a charm, thanks @nguyenhuy |
@@ -100,7 +100,7 @@ @implementation _ASPendingState | |||
@package //Expose all ivars for ASDisplayNode to bypass getters for efficiency | |||
|
|||
UIViewAutoresizing autoresizingMask; | |||
unsigned int edgeAntialiasingMask; | |||
CAEdgeAntialiasingMask edgeAntialiasingMask; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hanton not a blocking comment, but I think there are other places in which we also use unsigned int
instead of CAEdgeAntialiasingMask
? I'm totally down to change them too :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nguyenhuy sorry for missing this comment :p
The PR for fixing this issue is ready at #1667
Awesome. Let's get this in. Thanks for the contribution as well as helping to test the new CI setup! |
* Simplify code logic * Keep using user-defined type
Minor code improvements, including: