-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Replace let/nil-check patterns with guard let
#157
Conversation
The let/nil-check pattern is more expensive and less elegant than `guard let`.
subscriptBaseAddress: UnsafeMutablePointer(cocoaStorageBaseAddress), | ||
indices: subRange, | ||
hasNativeBuffer: false) | ||
guard let cocoaStorageBaseAddress = cocoa.contiguousStorage(self.indices) else { |
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.
I prefer this the old way. guard
is supposed to be a quick-exit path, and in this case, if
plays that role well.
Please update the pull request based on the comments. Did you run the tests? |
@gribozavr @radex Thanks for the comments! I will replace branches with non-trivial amount of code on either side with the |
@gribozavr I couldn't test this PR because
|
@dbworku Are you running the latest Xcode beta? I have never seen this issue, but it is a possibility that there is a missing dependency in LLVM's CMake scripts. Could you run |
@gribozavr @dbworku Please do not commit changes to Array before running the performance test suite. Array is special and regressing the performance of array to improve readability is not okay. |
The cmark_node struct and the node.h header are private.
@gribozavr @nadavrot @dbworku These changes don't look like they should affect performance. I am fine with this going in after @gribozavr gives his okay. |
@aschwaighofer Thank you for reviewing! I'm OK with the parts that I marked as LGTM in other comments. |
Fix whitespace in test/type
Don't rely on cmark internals
I filed this under Radar rather than bugs.swift.org because it's /only/ our CI system that's failing, and external contributors have no insight into that anyway. Hopefully I'll be able to get to the bottom of this soon.
This is needed for Xcode support, even though it appeared dead within the Swift repo itself.
The let/nil-check pattern is more expensive and less elegant than `guard let`.
@gribozavr Deleting/Reinstalling both Xcode's (release and beta) fixed my build issues. I mangled this branch's history when rebasing after the PR #193 changes. Closing this PR in favor of a single commit that includes all of the requested changes. |
Add Arrow Expressions
Refactor SyntaxRewriter
Disable an SCK project: Pods.
The let/nil-check pattern is more expensive and less elegant than
guard let
.guard let
is also less expensive.The change on
LazyMapGenerator
should increase performance negligibly ofmap()
.