Skip to content

Commit

Permalink
Merge pull request #4551 from Nirma/string_fix
Browse files Browse the repository at this point in the history
[stdlib] Move empty check for string concatenation to front
  • Loading branch information
lattner committed Aug 31, 2016
2 parents ab59308 + 3fa0946 commit 75f4c58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/public/core/String.swift
Expand Up @@ -704,10 +704,10 @@ extension String {
@effects(readonly)
@_semantics("string.concat")
public static func + (lhs: String, rhs: String) -> String {
var lhs = lhs
if lhs.isEmpty {
return rhs
}
var lhs = lhs
lhs._core.append(rhs._core)
return lhs
}
Expand Down

0 comments on commit 75f4c58

Please sign in to comment.