mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[stdlib] Add a default generate() for generators...
...that are also sequences, and rip out all redundant implementations of generate() that match a default. Swift SVN r30035
This commit is contained in:
@@ -212,16 +212,6 @@ public struct EnumerateGenerator<
|
||||
if b == nil { return .None }
|
||||
return .Some((index: count++, element: b!))
|
||||
}
|
||||
|
||||
/// A type whose instances can produce the elements of this
|
||||
/// sequence, in order.
|
||||
public typealias Generator = EnumerateGenerator<Base>
|
||||
|
||||
/// `EnumerateGenerator` is also a `SequenceType`, so it
|
||||
/// `generate`s a copy of itself.
|
||||
public func generate() -> Generator {
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
/// The `SequenceType` returned by `enumerate()`. `EnumerateSequence`
|
||||
|
||||
Reference in New Issue
Block a user