Skip to content

[stdlib] Move empty check for string concatenation to front #4551

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

Merged
merged 1 commit into from
Aug 31, 2016
Merged

[stdlib] Move empty check for string concatenation to front #4551

merged 1 commit into from
Aug 31, 2016

Conversation

Nirma
Copy link
Contributor

@Nirma Nirma commented Aug 30, 2016

I think its best to check if the left hand side is empty first before making a mutable copy so I moved the empty check to the front of the function.

This way a mutable copy of lhs is made only when it is actually used.

@lattner
Copy link
Contributor

lattner commented Aug 30, 2016

Nice catch!

@gottesmm
Copy link
Contributor

Seems like an obviously good change.

@swift-ci Please smoke test and merge

@Nirma
Copy link
Contributor Author

Nirma commented Aug 31, 2016

@gottesmm The OS X Smoke test passed but the smoke test for the linux platform failed.
The failure seems unrelated to me but how does it look?

Thanks!!

@lattner lattner merged commit 75f4c58 into swiftlang:master Aug 31, 2016
kateinoigakukun added a commit that referenced this pull request Aug 31, 2022
[pull] swiftwasm from main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants