mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Reinstate r29043 "strip final from protocol extensions".
This reverts r29050. This wasn't the change that broke the SourceKit tests. Swift SVN r29052
This commit is contained in:
@@ -35,7 +35,7 @@ extension SequenceType {
|
||||
/// 2: 'i'
|
||||
/// 3: 'f'
|
||||
/// 4: 't'
|
||||
final public func enumerate() -> EnumerateSequence<Self> {
|
||||
public func enumerate() -> EnumerateSequence<Self> {
|
||||
return EnumerateSequence(self)
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ extension SequenceType ${"" if preds else "where Generator.Element : Comparable"
|
||||
/// - Complexity: O(`elements.count`).
|
||||
///
|
||||
/// ${orderingRequirement}
|
||||
final public func minElement(
|
||||
public func minElement(
|
||||
% if preds:
|
||||
@noescape isOrderedBefore: (${GElement}, ${GElement}) -> Bool
|
||||
% end
|
||||
@@ -86,7 +86,7 @@ extension SequenceType ${"" if preds else "where Generator.Element : Comparable"
|
||||
///
|
||||
/// - Complexity: O(`elements.count`).
|
||||
/// ${orderingRequirement}
|
||||
final public func maxElement(
|
||||
public func maxElement(
|
||||
% if preds:
|
||||
@noescape isOrderedBefore: (${GElement}, ${GElement}) -> Bool
|
||||
% end
|
||||
@@ -131,7 +131,7 @@ else:
|
||||
/// Return true if `other` is empty."""
|
||||
}%
|
||||
${comment}
|
||||
final public func startsWith<
|
||||
public func startsWith<
|
||||
OtherSequence : SequenceType where OtherSequence.${GElement} == ${GElement}
|
||||
>(
|
||||
other: OtherSequence${"," if preds else ""}
|
||||
@@ -181,7 +181,7 @@ else:
|
||||
}%
|
||||
|
||||
${comment}
|
||||
final public func elementsEqual<
|
||||
public func elementsEqual<
|
||||
OtherSequence : SequenceType where OtherSequence.${GElement} == ${GElement}
|
||||
>(
|
||||
other: OtherSequence${"," if preds else ""}
|
||||
@@ -249,7 +249,7 @@ else:
|
||||
}%
|
||||
|
||||
${comment}
|
||||
final public func lexicographicalCompare<
|
||||
public func lexicographicalCompare<
|
||||
OtherSequence : SequenceType where OtherSequence.${GElement} == ${GElement}
|
||||
>(
|
||||
other: OtherSequence${"," if preds else ""}
|
||||
@@ -286,7 +286,7 @@ else:
|
||||
|
||||
extension SequenceType where Generator.Element : Equatable {
|
||||
/// Return `true` iff `x` is in `self`.
|
||||
final public func contains(element: ${GElement}) -> Bool {
|
||||
public func contains(element: ${GElement}) -> Bool {
|
||||
if let result = _customContainsEquatableElement(element) {
|
||||
return result
|
||||
}
|
||||
@@ -302,7 +302,7 @@ extension SequenceType where Generator.Element : Equatable {
|
||||
|
||||
extension SequenceType {
|
||||
/// Return `true` iff an element in `self` satisfies `predicate`.
|
||||
final public func contains(
|
||||
public func contains(
|
||||
@noescape predicate: (${GElement}) -> Bool
|
||||
) -> Bool {
|
||||
for e in self {
|
||||
@@ -324,7 +324,7 @@ extension SequenceType {
|
||||
/// `self`, in turn, i.e. return
|
||||
/// `combine(combine(...combine(combine(initial, self[0]),
|
||||
/// self[1]),...self[count-2]), self[count-1])`.
|
||||
final public func reduce<T>(
|
||||
public func reduce<T>(
|
||||
initial: T, @noescape combine: (T, ${GElement}) -> T
|
||||
) -> T {
|
||||
var result = initial
|
||||
@@ -342,7 +342,7 @@ extension SequenceType {
|
||||
extension SequenceType {
|
||||
/// Return an `Array` containing the elements of `self` in reverse
|
||||
/// order.
|
||||
final public func reverse() -> [${GElement}] {
|
||||
public func reverse() -> [${GElement}] {
|
||||
// FIXME(performance): optimize to 1 pass? But Array(self) can be
|
||||
// optimized to a memcpy() sometimes. Those cases are usually collections,
|
||||
// though.
|
||||
@@ -358,7 +358,7 @@ extension SequenceType {
|
||||
extension CollectionType where Index : BidirectionalIndexType {
|
||||
/// Return a lazy `CollectionType` containing the elements of `self`
|
||||
/// in reverse order.
|
||||
final public func reverse() -> BidirectionalReverseView<Self> {
|
||||
public func reverse() -> BidirectionalReverseView<Self> {
|
||||
return BidirectionalReverseView(self)
|
||||
}
|
||||
}
|
||||
@@ -366,7 +366,7 @@ extension CollectionType where Index : BidirectionalIndexType {
|
||||
extension CollectionType where Index : RandomAccessIndexType {
|
||||
/// Return a lazy `CollectionType` containing the elements of `self`
|
||||
/// in reverse order.
|
||||
final public func reverse() -> RandomAccessReverseView<Self> {
|
||||
public func reverse() -> RandomAccessReverseView<Self> {
|
||||
return RandomAccessReverseView(self)
|
||||
}
|
||||
}
|
||||
@@ -378,7 +378,7 @@ extension CollectionType where Index : RandomAccessIndexType {
|
||||
extension SequenceType {
|
||||
/// Return an `Array` containing concatenated results of mapping `transform`
|
||||
/// over `self`.
|
||||
final public func flatMap<S : SequenceType>(
|
||||
public func flatMap<S : SequenceType>(
|
||||
@noescape transform: (${GElement}) -> S
|
||||
) -> [S.${GElement}] {
|
||||
var result: [S.${GElement}] = []
|
||||
@@ -392,7 +392,7 @@ extension SequenceType {
|
||||
extension SequenceType {
|
||||
/// Return an `Array` containing the non-nil results of mapping `transform`
|
||||
/// over `self`.
|
||||
final public func flatMap<T>(
|
||||
public func flatMap<T>(
|
||||
@noescape transform: (${GElement}) -> T?
|
||||
) -> [T] {
|
||||
var result: [T] = []
|
||||
|
||||
Reference in New Issue
Block a user