Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit f544156

Browse files
committed
Remove withoutActuallyEscaping, concurrentPerform already accepts nonescaping closure
1 parent bac2610 commit f544156

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

Sources/SwiftDoc/Extensions/Array+Parallel.swift

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,17 @@ public extension RandomAccessCollection {
1212
results.reserveCapacity(count)
1313

1414
let queue = DispatchQueue(label: #function)
15-
withoutActuallyEscaping(transform) { escapingtransform in
16-
DispatchQueue.concurrentPerform(iterations: count) { (iteration) in
17-
let index = indices[iteration]
18-
19-
do {
20-
let transformed = try escapingtransform(self[index])
21-
queue.sync {
22-
results.append((index, .success(transformed)))
23-
}
24-
} catch {
25-
queue.sync {
26-
results.append((index, .failure(error)))
27-
}
15+
DispatchQueue.concurrentPerform(iterations: count) { (iteration) in
16+
let index = indices[iteration]
17+
18+
do {
19+
let transformed = try transform(self[index])
20+
queue.sync {
21+
results.append((index, .success(transformed)))
22+
}
23+
} catch {
24+
queue.sync {
25+
results.append((index, .failure(error)))
2826
}
2927
}
3028
}

0 commit comments

Comments
 (0)