mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[String] Custom iterator for UTF16View (#20929)
Defining a custom iterator for the UTF16View avoid some redundant computation over the indexing model. This speeds up iteration by around 40% on non-ASCII strings.
This commit is contained in:
@@ -234,8 +234,8 @@ extension String {
|
||||
|
||||
@inlinable
|
||||
internal init(_ guts: _StringGuts) {
|
||||
self._guts = guts
|
||||
self._end = guts.count
|
||||
self._guts = guts
|
||||
}
|
||||
|
||||
@inlinable
|
||||
|
||||
Reference in New Issue
Block a user