Skip to content

Commit

Permalink
Change macro
Browse files Browse the repository at this point in the history
mtj0928 committed Oct 4, 2024
1 parent 77d6e23 commit 5df3d26
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if swift(>=6.0)
#if compiler(>=6.0)
/// A wrapper function of `withTaskGroup`.
///
/// The main difference with `withTaskGroup` is that the group's next function returns the results in the order the tasks were added.
@@ -53,7 +53,7 @@ public struct OrderedTaskGroup<ChildTaskResult: Sendable> {
self.internalGroup = internalGroup
}

#if swift(>=6.0)
#if compiler(>=6.0)
public mutating func addTask(
priority: TaskPriority? = nil,
operation: sending @escaping @isolated(any) () async -> ChildTaskResult
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if swift(>=6.0)
#if compiler(>=6.0)
/// A wrapper function of `withThrowingTaskGroup`.
///
/// The main difference with `withThrowingTaskGroup` is that the group's next function returns the results in the order the tasks were added.
@@ -50,7 +50,6 @@ public func withThrowingOrderedTaskGroup<ChildTaskResult: Sendable, GroupResult>
return try await body(&throwingOrderedTaskGroup)
}
}

#endif

public struct ThrowingOrderedTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
@@ -63,7 +62,7 @@ public struct ThrowingOrderedTaskGroup<ChildTaskResult: Sendable, Failure: Error
self.internalGroup = internalGroup
}

#if swift(>=6.0)
#if compiler(>=6.0)
public mutating func addTask(
priority: TaskPriority? = nil,
operation: sending @escaping @isolated(any) () async throws(Failure) -> ChildTaskResult

0 comments on commit 5df3d26

Please sign in to comment.