mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[noescape by default] drop @noescape from stdlib
This commit is contained in:
@@ -121,7 +121,7 @@ ${orderingExplanation}
|
||||
@warn_unqualified_access
|
||||
public func min(
|
||||
% if preds:
|
||||
by areInIncreasingOrder: @noescape (${GElement}, ${GElement}) throws -> Bool
|
||||
by areInIncreasingOrder: (${GElement}, ${GElement}) throws -> Bool
|
||||
% end
|
||||
) ${rethrows_}-> ${GElement}? {
|
||||
var it = makeIterator()
|
||||
@@ -174,7 +174,7 @@ ${orderingExplanation}
|
||||
@warn_unqualified_access
|
||||
public func max(
|
||||
% if preds:
|
||||
by areInIncreasingOrder: @noescape (${GElement}, ${GElement}) throws -> Bool
|
||||
by areInIncreasingOrder: (${GElement}, ${GElement}) throws -> Bool
|
||||
% end
|
||||
) ${rethrows_}-> ${GElement}? {
|
||||
var it = makeIterator()
|
||||
@@ -242,7 +242,7 @@ ${equivalenceExplanation}
|
||||
public func starts<PossiblePrefix>(
|
||||
with possiblePrefix: PossiblePrefix${"," if preds else ""}
|
||||
% if preds:
|
||||
by areEquivalent: @noescape (${GElement}, ${GElement}) throws -> Bool
|
||||
by areEquivalent: (${GElement}, ${GElement}) throws -> Bool
|
||||
% end
|
||||
) ${rethrows_}-> Bool
|
||||
where
|
||||
@@ -318,7 +318,7 @@ ${equivalenceExplanation}
|
||||
public func elementsEqual<OtherSequence>(
|
||||
_ other: OtherSequence${"," if preds else ""}
|
||||
% if preds:
|
||||
by areEquivalent: @noescape (${GElement}, ${GElement}) throws -> Bool
|
||||
by areEquivalent: (${GElement}, ${GElement}) throws -> Bool
|
||||
% end
|
||||
) ${rethrows_}-> Bool
|
||||
where
|
||||
@@ -404,7 +404,7 @@ ${orderingExplanation}
|
||||
_ other: OtherSequence${"," if preds else ""}
|
||||
% if preds:
|
||||
by areInIncreasingOrder:
|
||||
@noescape (${GElement}, ${GElement}) throws -> Bool
|
||||
(${GElement}, ${GElement}) throws -> Bool
|
||||
% end
|
||||
) ${rethrows_}-> Bool
|
||||
where
|
||||
@@ -505,7 +505,7 @@ extension Sequence {
|
||||
/// - Returns: `true` if the sequence contains an element that satisfies
|
||||
/// `predicate`; otherwise, `false`.
|
||||
public func contains(
|
||||
where predicate: @noescape (${GElement}) throws -> Bool
|
||||
where predicate: (${GElement}) throws -> Bool
|
||||
) rethrows -> Bool {
|
||||
for e in self {
|
||||
if try predicate(e) {
|
||||
@@ -555,7 +555,7 @@ extension Sequence {
|
||||
public func reduce<Result>(
|
||||
_ initialResult: Result,
|
||||
_ nextPartialResult:
|
||||
@noescape (_ partialResult: Result, ${GElement}) throws -> Result
|
||||
(_ partialResult: Result, ${GElement}) throws -> Result
|
||||
) rethrows -> Result {
|
||||
var accumulator = initialResult
|
||||
for element in self {
|
||||
@@ -625,7 +625,7 @@ extension Sequence {
|
||||
/// and *n* is the length of the result.
|
||||
/// - SeeAlso: `joined()`, `map(_:)`
|
||||
public func flatMap<SegmentOfResult : Sequence>(
|
||||
_ transform: @noescape (${GElement}) throws -> SegmentOfResult
|
||||
_ transform: (${GElement}) throws -> SegmentOfResult
|
||||
) rethrows -> [SegmentOfResult.${GElement}] {
|
||||
var result: [SegmentOfResult.${GElement}] = []
|
||||
for element in self {
|
||||
@@ -661,7 +661,7 @@ extension Sequence {
|
||||
/// - Complexity: O(*m* + *n*), where *m* is the length of this sequence
|
||||
/// and *n* is the length of the result.
|
||||
public func flatMap<ElementOfResult>(
|
||||
_ transform: @noescape (${GElement}) throws -> ElementOfResult?
|
||||
_ transform: (${GElement}) throws -> ElementOfResult?
|
||||
) rethrows -> [ElementOfResult] {
|
||||
var result: [ElementOfResult] = []
|
||||
for element in self {
|
||||
@@ -681,14 +681,14 @@ extension Sequence {
|
||||
|
||||
@available(*, unavailable, renamed: "min(by:)")
|
||||
public func minElement(
|
||||
_ isOrderedBefore: @noescape (Iterator.Element, Iterator.Element) throws -> Bool
|
||||
_ isOrderedBefore: (Iterator.Element, Iterator.Element) throws -> Bool
|
||||
) rethrows -> Iterator.Element? {
|
||||
Builtin.unreachable()
|
||||
}
|
||||
|
||||
@available(*, unavailable, renamed: "max(by:)")
|
||||
public func maxElement(
|
||||
_ isOrderedBefore: @noescape (Iterator.Element, Iterator.Element) throws -> Bool
|
||||
_ isOrderedBefore: (Iterator.Element, Iterator.Element) throws -> Bool
|
||||
) rethrows -> Iterator.Element? {
|
||||
Builtin.unreachable()
|
||||
}
|
||||
@@ -701,7 +701,7 @@ extension Sequence {
|
||||
@available(*, unavailable, renamed: "starts(with:by:)")
|
||||
public func startsWith<PossiblePrefix>(
|
||||
_ possiblePrefix: PossiblePrefix,
|
||||
isEquivalent: @noescape (Iterator.Element, Iterator.Element) throws -> Bool
|
||||
isEquivalent: (Iterator.Element, Iterator.Element) throws -> Bool
|
||||
) rethrows-> Bool
|
||||
where
|
||||
PossiblePrefix : Sequence,
|
||||
@@ -714,7 +714,7 @@ extension Sequence {
|
||||
OtherSequence
|
||||
>(
|
||||
_ other: OtherSequence,
|
||||
isOrderedBefore: @noescape (${GElement}, ${GElement}) throws -> Bool
|
||||
isOrderedBefore: (${GElement}, ${GElement}) throws -> Bool
|
||||
) rethrows -> Bool
|
||||
where
|
||||
OtherSequence : Sequence,
|
||||
|
||||
Reference in New Issue
Block a user