mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Add post-nil guarantee for IteratorProtocol.next() to always return nil
This commit is contained in:
@@ -162,11 +162,8 @@ extension String {
|
||||
}
|
||||
}
|
||||
|
||||
/// Advance to the next element and return it, or `nil` if no next
|
||||
/// element exists.
|
||||
///
|
||||
/// - Precondition: No preceding call to `self.next()` has returned
|
||||
/// `nil`.
|
||||
/// Advance to the next element and return it, or `nil` if no next element
|
||||
/// exists. Once `nil` has been returned, all subsequent calls return `nil`.
|
||||
public mutating func next() -> UnicodeScalar? {
|
||||
var result: UnicodeDecodingResult
|
||||
if _baseSet {
|
||||
|
||||
Reference in New Issue
Block a user