File tree Expand file tree Collapse file tree 1 file changed +0
-22
lines changed
stdlib/private/StdlibCollectionUnittest Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change @@ -22,14 +22,6 @@ from gyb_stdlib_support import (
22
22
23
23
import StdlibUnittest
24
24
25
- /// State that is created every time a fresh generator is created with
26
- /// `MinimalSequence.makeIterator()`.
27
- internal class _MinimalIteratorPrivateState < T> {
28
- internal init ( ) { }
29
-
30
- internal var returnedNilCounter : Int = 0
31
- }
32
-
33
25
/// State shared by all generators of a MinimalSequence.
34
26
internal class _MinimalIteratorSharedState < T> {
35
27
internal init ( _ data: [ T ] ) {
@@ -64,26 +56,12 @@ public struct MinimalIterator<T> : IteratorProtocol {
64
56
65
57
public func next( ) -> T ? {
66
58
if _sharedState. i == _sharedState. data. count {
67
- if isConsumed {
68
- expectUnreachable ( " next() was called on a consumed generator " )
69
- }
70
- _privateState. returnedNilCounter += 1
71
59
return nil
72
60
}
73
61
defer { _sharedState. i += 1 }
74
62
return _sharedState. data [ _sharedState. i]
75
63
}
76
64
77
- public var isConsumed : Bool {
78
- return returnedNilCounter >= 1
79
- }
80
-
81
- public var returnedNilCounter : Int {
82
- return _privateState. returnedNilCounter
83
- }
84
-
85
- internal let _privateState : _MinimalIteratorPrivateState < T > =
86
- _MinimalIteratorPrivateState ( )
87
65
internal let _sharedState : _MinimalIteratorSharedState < T >
88
66
}
89
67
You can’t perform that action at this time.
0 commit comments