Skip to content

Commit e8b15ca

Browse files
author
Nicholas Maccharoli
committed
[stdlib] simplify repeat to while
1 parent e5a6b22 commit e8b15ca

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

stdlib/public/core/SwiftNativeNSArray.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ extension _SwiftNativeNSArrayWithContiguousStorage : _NSArrayCore {
171171
internal override func withUnsafeBufferOfObjects<R>(
172172
_ body: (UnsafeBufferPointer<AnyObject>) throws -> R
173173
) rethrows -> R {
174-
repeat {
174+
while true {
175175
var buffer: UnsafeBufferPointer<AnyObject>
176176

177177
// If we've already got a buffer of bridged objects, just use it
@@ -206,7 +206,6 @@ extension _SwiftNativeNSArrayWithContiguousStorage : _NSArrayCore {
206206
defer { _fixLifetime(self) }
207207
return try body(buffer)
208208
}
209-
while true
210209
}
211210

212211
/// Returns the number of elements in the array.

0 commit comments

Comments
 (0)