stdlib: change underestimateCount() into a method

rdar://19895265

Swift SVN r27346
This commit is contained in:
Dmitri Hrybenko
2015-04-16 05:05:17 +00:00
parent c7c25ad298
commit c48d6aa0ab
10 changed files with 225 additions and 110 deletions

View File

@@ -55,16 +55,14 @@ public struct MapSequenceView<Base : SequenceType, T> : SequenceType {
_base: _base.generate(), _transform: _transform)
}
public func _prext_underestimateCount() -> Int {
return underestimateCount(_base)
}
var _base: Base
var _transform: (Base.Generator.Element)->T
}
public func ~> <Base : SequenceType, T> (
s: MapSequenceView<Base, T>, _: (_UnderestimateCount, ())
) -> Int {
return underestimateCount(s._base)
}
/// Return an `Array` containing the results of mapping `transform`
/// over `source`.
public func map<S : SequenceType, T>(
@@ -121,16 +119,14 @@ public struct MapCollectionView<Base : CollectionType, T> : CollectionType {
return MapSequenceGenerator(_base: _base.generate(), _transform: _transform)
}
public func _prext_underestimateCount() -> Int {
return underestimateCount(_base)
}
var _base: Base
var _transform: (Base.Generator.Element)->T
}
public func ~> <Base: CollectionType, T> (
s: MapCollectionView<Base, T>, _: (_UnderestimateCount, ())
) -> Int {
return underestimateCount(s._base)
}
/// Return an `Array` containing the results of mapping `transform`
/// over `source`.
public func map<C : CollectionType, T>(