Fix estimated length when removing characters
This commit is contained in:
parent
975834e1f6
commit
c91c15ec7f
@ -62,7 +62,7 @@ public extension String {
|
||||
|
||||
// Create the result string and set up a capacity close to the final string
|
||||
var result = ""
|
||||
result.reserveCapacity(self.count)
|
||||
result.reserveCapacity(self.utf8.count)
|
||||
|
||||
// Iterate through the ranges, appending the string between the last
|
||||
// match and the next, and then appending the replacement string
|
||||
|
||||
Loading…
Reference in New Issue
Block a user