Skip to content

Commit cdd127b

Browse files
committed
less code duplication
1 parent 9f5a707 commit cdd127b

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -503,36 +503,8 @@ struct JobFlags {
503503
func taskCreateFlags(
504504
priority: TaskPriority?, isChildTask: Bool, copyTaskLocals: Bool,
505505
inheritContext: Bool, enqueueJob: Bool,
506-
addPendingGroupTaskUnconditionally: Bool
507-
) -> Int {
508-
var bits = 0
509-
bits |= (bits & ~0xFF) | Int(priority?.rawValue ?? 0)
510-
if isChildTask {
511-
bits |= 1 << 8
512-
}
513-
if copyTaskLocals {
514-
bits |= 1 << 10
515-
}
516-
if inheritContext {
517-
bits |= 1 << 11
518-
}
519-
if enqueueJob {
520-
bits |= 1 << 12
521-
}
522-
if addPendingGroupTaskUnconditionally {
523-
bits |= 1 << 13
524-
}
525-
return bits
526-
}
527-
528-
/// Form task creation flags for use with the createAsyncTask builtins.
529-
@available(SwiftStdlib 5.9, *)
530-
@_alwaysEmitIntoClient
531-
func taskCreateFlags(
532-
priority: TaskPriority?, isChildTask: Bool, copyTaskLocals: Bool,
533-
inheritContext: Bool, enqueueJob: Bool,
534-
addPendingGroupTaskUnconditionally: Bool,
535-
isDiscardingTask: Bool
506+
addPendingGroupTaskUnconditionally: Bool,
507+
isDiscardingTask: Bool
536508
) -> Int {
537509
var bits = 0
538510
bits |= (bits & ~0xFF) | Int(priority?.rawValue ?? 0)

0 commit comments

Comments
 (0)