Skip to content

Commit be05690

Browse files
committed
Revert "stdlib/Zip: use more descriptive names for non-API identifiers"
This reverts commit r27922. I didn't update all use sites. Swift SVN r27924
1 parent b0e7cbd commit be05690

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

stdlib/public/core/Zip.swift

+22-23
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@
1313
/// A sequence of pairs built out of two underlying sequences, where
1414
/// the elements of the `i`th pair are the `i`th elements of each
1515
/// underlying sequence.
16-
public func zip<Sequence1 : SequenceType, Sequence2 : SequenceType>(
17-
sequence1: Sequence1, _ sequence2: Sequence2
18-
) -> Zip2<Sequence1, Sequence2> {
19-
return Zip2(sequence1, sequence2)
16+
public func zip<S0: SequenceType, S1: SequenceType>(
17+
s0: S0, _ s1: S1
18+
) -> Zip2<S0, S1> {
19+
return Zip2(s0, s1)
2020
}
2121

2222
/// A generator for the `Zip2` sequence
2323
public struct ZipGenerator2<
24-
Generator1 : GeneratorType, Generator2 : GeneratorType
24+
E0 : GeneratorType, E1 : GeneratorType
2525
> : GeneratorType {
2626
/// The type of element returned by `next()`.
27-
public typealias Element = (Generator1.Element, Generator2.Element)
27+
public typealias Element = (E0.Element,E1.Element)
2828

2929
/// Construct around a pair of underlying generators.
30-
public init(_ generator1: Generator1, _ generator2: Generator2) {
31-
baseStreams = (generator1, generator2)
30+
public init(_ e0: E0, _ e1: E1) {
31+
baseStreams = (e0,e1)
3232
}
3333

3434
/// Advance to the next element and return it, or `nil` if no next
@@ -61,37 +61,36 @@ public struct ZipGenerator2<
6161
return .Some((e0!, e1!))
6262
}
6363

64-
internal var _baseStreams: (Generator1, Generator2)
65-
internal var _reachedEnd: Bool = false
64+
var baseStreams: (E0, E1)
65+
var reachedEnd: Bool = false
6666
}
6767

6868
/// A sequence of pairs built out of two underlying sequences, where
6969
/// the elements of the `i`th pair are the `i`th elements of each
7070
/// underlying sequence.
71-
public struct Zip2<Sequence1 : SequenceType, Sequence2 : SequenceType>
72-
: SequenceType {
73-
74-
public typealias Stream1 = Sequence1.Generator
75-
public typealias Stream2 = Sequence2.Generator
76-
71+
public struct Zip2<S0: SequenceType, S1: SequenceType> : SequenceType
72+
{
73+
public typealias Stream1 = S0.Generator
74+
public typealias Stream2 = S1.Generator
75+
7776
/// A type whose instances can produce the elements of this
7877
/// sequence, in order.
7978
public typealias Generator = ZipGenerator2<Stream1, Stream2>
8079

81-
/// Construct an instance that makes pairs of elements from `sequence1` and
82-
/// `sequence2`.
83-
public init(_ sequence1: Sequence1, _ sequence2: Sequence2) {
84-
_sequences = (sequence1, sequence2)
80+
/// Construct an instance that makes pairs of elements from `s0` and
81+
/// `s1`.
82+
public init(_ s0: S0, _ s1: S1) {
83+
sequences = (s0,s1)
8584
}
8685

8786
/// Return a *generator* over the elements of this *sequence*.
8887
///
8988
/// - complexity: O(1)
9089
public func generate() -> Generator {
9190
return Generator(
92-
_sequences.0.generate(),
93-
_sequences.1.generate())
91+
sequences.0.generate(),
92+
sequences.1.generate())
9493
}
9594

96-
internal let _sequences: (Sequence1, Sequence2)
95+
var sequences: (S0,S1)
9796
}

0 commit comments

Comments
 (0)