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:
@@ -60,7 +60,7 @@ public func _persistCString(s: UnsafePointer<CChar>) -> [CChar]? {
|
||||
}
|
||||
let length = Int(_swift_stdlib_strlen(s))
|
||||
var result = [CChar](count: length + 1, repeatedValue: 0)
|
||||
for var i = 0; i < length; i += 1 {
|
||||
for i in 0..<length {
|
||||
// FIXME: this will not compile on platforms where 'CChar' is unsigned.
|
||||
result[i] = s[i]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user