We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bc053f commit f6f36faCopy full SHA for f6f36fa
stdlib/public/core/Slice.swift
@@ -237,9 +237,8 @@ extension Slice {
237
if let (_, copied) = self.withContiguousStorageIfAvailable({
238
$0._copyContents(initializing: buffer)
239
}) {
240
- let distance = buffer.distance(from: buffer.startIndex, to: copied)
241
- let i = index(startIndex, offsetBy: distance)
242
- return (Iterator(_elements: self, _position: i), copied)
+ let position = index(startIndex, offsetBy: copied)
+ return (Iterator(_elements: self, _position: position), copied)
243
}
244
245
return _copySequenceContents(initializing: buffer)
0 commit comments