@@ -67,76 +67,4 @@ public class CommitIterator: IteratorProtocol, Sequence {
67
67
return result
68
68
}
69
69
}
70
-
71
- public func makeIterator( ) -> CommitIterator {
72
- return self
73
- }
74
-
75
- public private( set) var underestimatedCount : Int = 0
76
- public func map< T> ( _ transform: ( Result < Commit , NSError > ) throws -> T ) rethrows -> [ T ] {
77
- var new : [ T ] = [ ]
78
- for item in self {
79
- new += [ try transform ( item) ]
80
- }
81
- return new
82
- }
83
-
84
- public func filter( _ isIncluded: ( Result < Commit , NSError > ) throws -> Bool ) rethrows -> [ Result < Commit , NSError > ] {
85
- var new : [ Result < Commit , NSError > ] = [ ]
86
- for item in self {
87
- if try isIncluded ( item) {
88
- new += [ item]
89
- }
90
- }
91
- return new
92
- }
93
-
94
- public func forEach( _ body: ( Result < Commit , NSError > ) throws -> Void ) rethrows {
95
- for item in self {
96
- try body ( item)
97
- }
98
- }
99
-
100
- private func notImplemented( functionName: Any ) {
101
- assert ( false , " CommitIterator does not implement \( functionName) " )
102
- }
103
- private init ( repo: Repository ) {
104
- self . repo = repo
105
- }
106
-
107
- public func dropFirst( _ num: Int ) -> AnySequence < Iterator . Element > {
108
- notImplemented ( functionName: self . dropFirst)
109
- return AnySequence< Iterator . Element> { return CommitIterator ( repo: self . repo) }
110
- }
111
-
112
- public func dropLast( _ num: Int ) -> AnySequence < Iterator . Element > {
113
- notImplemented ( functionName: self . dropLast)
114
- return AnySequence< Iterator . Element> { return CommitIterator ( repo: self . repo) }
115
- }
116
-
117
- public func drop( while predicate: ( Result < Commit , NSError > ) throws -> Bool ) rethrows -> AnySequence < Iterator . Element > {
118
- notImplemented ( functionName: self . drop)
119
- return AnySequence< Iterator . Element> { return CommitIterator ( repo: self . repo) }
120
- }
121
-
122
- public func prefix( _ maxLength: Int ) -> AnySequence < Iterator . Element > {
123
- notImplemented ( functionName: " prefix(_ maxLength: " )
124
- return AnySequence< Iterator . Element> { return CommitIterator ( repo: self . repo) }
125
- }
126
-
127
- public func prefix( while predicate: ( Result < Commit , NSError > ) throws -> Bool ) rethrows -> AnySequence < Iterator . Element > {
128
- notImplemented ( functionName: " prefix(with predicate: " )
129
- return AnySequence< Iterator . Element> { return CommitIterator ( repo: self . repo) }
130
- }
131
-
132
- public func suffix( _ maxLength: Int ) -> AnySequence < Iterator . Element > {
133
- notImplemented ( functionName: self . suffix)
134
- return AnySequence< Iterator . Element> { return CommitIterator ( repo: self . repo) }
135
- }
136
-
137
- public func split( maxSplits: Int , omittingEmptySubsequences: Bool , whereSeparator isSeparator: ( Result < Commit , NSError > ) throws -> Bool ) rethrows -> [ AnySequence < Iterator . Element > ] {
138
- notImplemented ( functionName: self . split)
139
- return [ AnySequence< Iterator . Element> { return CommitIterator ( repo: self . repo) } ]
140
- }
141
-
142
70
}
0 commit comments