Skip to content

Commit 57bddb7

Browse files
[stdlib] Change post-nil guarantee for missed case of IteratorType.next()
1 parent 07a8c39 commit 57bddb7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

stdlib/public/core/Filter.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818
public struct LazyFilterIterator<
1919
Base : IteratorProtocol
2020
> : IteratorProtocol, Sequence {
21-
/// Advances to the next element and returns it, or `nil` if no next
22-
/// element exists.
21+
/// Advance to the next element and return it, or `nil` if no next element
22+
/// exists. Once `nil` has been returned, all subsequent calls return `nil`.
2323
///
2424
/// - Precondition: `next()` has not been applied to a copy of `self`
25-
/// since the copy was made, and no preceding call to `self.next()`
26-
/// has returned `nil`.
25+
/// since the copy was made.
2726
public mutating func next() -> Base.Element? {
2827
while let n = _base.next() {
2928
if _predicate(n) {

0 commit comments

Comments
 (0)