13
13
extension Sequence {
14
14
/// Just like `Sequence.map` but allows an `async` transform function.
15
15
package func asyncMap< T> (
16
- @ _inheritActorContext _ transform: @ Sendable ( Element) async throws -> T
16
+ _ transform: ( Element ) async throws -> T
17
17
) async rethrows -> [ T ] {
18
18
var result : [ T ] = [ ]
19
19
result. reserveCapacity ( self . underestimatedCount)
@@ -27,7 +27,7 @@ extension Sequence {
27
27
28
28
/// Just like `Sequence.flatMap` but allows an `async` transform function.
29
29
package func asyncFlatMap< SegmentOfResult: Sequence > (
30
- @ _inheritActorContext _ transform: @ Sendable ( Element) async throws -> SegmentOfResult
30
+ _ transform: ( Element ) async throws -> SegmentOfResult
31
31
) async rethrows -> [ SegmentOfResult . Element ] {
32
32
var result : [ SegmentOfResult . Element ] = [ ]
33
33
result. reserveCapacity ( self . underestimatedCount)
@@ -41,7 +41,7 @@ extension Sequence {
41
41
42
42
/// Just like `Sequence.compactMap` but allows an `async` transform function.
43
43
package func asyncCompactMap< T> (
44
- @ _inheritActorContext _ transform: @ Sendable ( Element) async throws -> T ?
44
+ _ transform: ( Element ) async throws -> T ?
45
45
) async rethrows -> [ T ] {
46
46
var result : [ T ] = [ ]
47
47
@@ -56,7 +56,7 @@ extension Sequence {
56
56
57
57
/// Just like `Sequence.map` but allows an `async` transform function.
58
58
package func asyncFilter(
59
- @ _inheritActorContext _ predicate: @ Sendable ( Element) async throws -> Bool
59
+ _ predicate: ( Element ) async throws -> Bool
60
60
) async rethrows -> [ Element ] {
61
61
var result : [ Element ] = [ ]
62
62
@@ -70,9 +70,7 @@ extension Sequence {
70
70
}
71
71
72
72
/// Just like `Sequence.first` but allows an `async` predicate function.
73
- package func asyncFirst(
74
- @_inheritActorContext where predicate: @Sendable ( Element) async throws -> Bool
75
- ) async rethrows -> Element ? {
73
+ package func asyncFirst( where predicate: ( Element ) async throws -> Bool ) async rethrows -> Element ? {
76
74
for element in self {
77
75
if try await predicate ( element) {
78
76
return element
@@ -84,7 +82,7 @@ extension Sequence {
84
82
85
83
/// Just like `Sequence.contains` but allows an `async` predicate function.
86
84
package func asyncContains(
87
- @ _inheritActorContext where predicate: @ Sendable ( Element) async throws -> Bool
85
+ where predicate: ( Element ) async throws -> Bool
88
86
) async rethrows -> Bool {
89
87
return try await asyncFirst ( where: predicate) != nil
90
88
}
0 commit comments