[stdlib] simplify repeat to while

This commit is contained in:
Nicholas Maccharoli
2016-09-02 12:06:01 +09:00
parent e5a6b2240e
commit e8b15ca17d

View File

@@ -171,7 +171,7 @@ extension _SwiftNativeNSArrayWithContiguousStorage : _NSArrayCore {
internal override func withUnsafeBufferOfObjects<R>(
_ body: (UnsafeBufferPointer<AnyObject>) throws -> R
) rethrows -> R {
repeat {
while true {
var buffer: UnsafeBufferPointer<AnyObject>
// If we've already got a buffer of bridged objects, just use it
@@ -206,7 +206,6 @@ extension _SwiftNativeNSArrayWithContiguousStorage : _NSArrayCore {
defer { _fixLifetime(self) }
return try body(buffer)
}
while true
}
/// Returns the number of elements in the array.