File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -144,9 +144,19 @@ extension String: RangeReplaceableCollection {
144
144
/// Appends the characters in the given sequence to the string.
145
145
///
146
146
/// - Parameter newElements: A sequence of characters.
147
- @inlinable // @specializable
147
+ @_specialize ( where S == String)
148
+ @_specialize ( where S == Substring)
149
+ @_specialize ( where S == Array< Character> )
148
150
public mutating func append< S : Sequence > ( contentsOf newElements: S )
149
151
where S. Iterator. Element == Character {
152
+ if let str = newElements as? String {
153
+ self . append ( str)
154
+ return
155
+ }
156
+ if let substr = newElements as? Substring {
157
+ self . append ( contentsOf: substr)
158
+ return
159
+ }
150
160
for c in newElements {
151
161
self . append ( c. _str)
152
162
}
You can’t perform that action at this time.
0 commit comments