mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Change C-style for loop to Swift-style for-in loop
This commit is contained in:
@@ -145,7 +145,7 @@ extension String.CharacterView : CollectionType {
|
||||
unicodeScalars[start].value)
|
||||
start._successorInPlace()
|
||||
|
||||
for ; start != end; start._successorInPlace() {
|
||||
while start != end {
|
||||
// FIXME(performance): consider removing this "fast path". A branch
|
||||
// that is hard to predict could be worse for performance than a few
|
||||
// loads from cache to fetch the property 'gcb1'.
|
||||
@@ -158,6 +158,7 @@ extension String.CharacterView : CollectionType {
|
||||
break
|
||||
}
|
||||
gcb0 = gcb1
|
||||
start._successorInPlace()
|
||||
}
|
||||
|
||||
return start._position - startIndexUTF16
|
||||
|
||||
Reference in New Issue
Block a user