mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] swapAt method (#9119)
* Add swapAt method * Migrate sorting to swapAt * Migrate further stdlib usage
This commit is contained in:
@@ -642,7 +642,7 @@ extension Sequence {
|
||||
var result = Array(self)
|
||||
let count = result.count
|
||||
for i in 0..<count/2 {
|
||||
swap(&result[i], &result[count - ((i + 1) as Int)])
|
||||
result.swapAt(i, count - ((i + 1) as Int))
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user