Skip to content

Commit 27f7446

Browse files
committed
elide unecessary task creation in SingleshotSubmission
1 parent c3c8d8c commit 27f7446

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Sources/IORing/Submission.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,10 @@ final class SingleshotSubmission<T: Sendable>: Submission<T>, @unchecked Sendabl
210210
try await withUnsafeThrowingContinuation { continuation in
211211
// guaranteed to run immediately
212212
self.continuation = continuation
213-
Task {
214-
if group != nil {
215-
await ready()
216-
} else {
217-
try ring.submit()
218-
}
213+
if group != nil {
214+
Task { await ready() }
215+
} else {
216+
_ = try? ring.submit()
219217
}
220218
}
221219
}, onCancel: {

0 commit comments

Comments
 (0)