Skip to content

Commit 20971fa

Browse files
committed
Only use named tasks with Swift 6.2 compilers
1 parent e80fb90 commit 20971fa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Sources/SwiftDocC/Utility/Collection+ConcurrentPerform.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,15 @@ extension Collection {
199199
remaining = remaining.dropFirst(numberOfElementsPerTask)
200200

201201
// Start work of one slice of the known pages
202+
#if compiler(<6.2)
203+
taskGroup.addTask {
204+
return try work(slice)
205+
}
206+
#else
202207
taskGroup.addTask(name: taskName) {
203208
return try work(slice)
204209
}
210+
#endif
205211
}
206212
}
207213

@@ -220,9 +226,15 @@ extension Collection {
220226
remaining = remaining.dropFirst(numberOfElementsPerTask)
221227

222228
// Start work of one slice of the known pages
229+
#if compiler(<6.2)
230+
taskGroup.addTask {
231+
return try work(slice)
232+
}
233+
#else
223234
taskGroup.addTask(name: taskName) {
224235
return try work(slice)
225236
}
237+
#endif
226238
}
227239
}
228240

0 commit comments

Comments
 (0)