mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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:
@@ -180,8 +180,8 @@ extension String.UnicodeScalarView {
|
||||
|
||||
@inlinable
|
||||
internal init(_ guts: _StringGuts) {
|
||||
self._guts = guts
|
||||
self._end = guts.count
|
||||
self._guts = guts
|
||||
}
|
||||
|
||||
@inlinable
|
||||
|
||||
Reference in New Issue
Block a user