Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

Commit

Permalink
Modern Swift supports this recursive generic
Browse files Browse the repository at this point in the history
  • Loading branch information
zwaldowski committed Aug 31, 2020
1 parent 05b2ba9 commit 9143c15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Deferred/DeferredQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ extension Deferred {
/// The use of `ManagedBuffer` ensures aligned and heap-allocated addresses
/// for the storage. The storage is tail-allocated with a reference to the
/// next node.
final class Node: ManagedBuffer<AnyObject?, Continuation> {
fileprivate static func create(with continuation: Continuation) -> Node {
final class Node: ManagedBuffer<Node?, Continuation> {
static func create(with continuation: Continuation) -> Node {
let storage = super.create(minimumCapacity: 1, makingHeaderWith: { _ in nil })

storage.withUnsafeMutablePointers { (_, pointerToContinuation) in
Expand Down Expand Up @@ -48,7 +48,7 @@ private extension Deferred.Node {
var next: Deferred.Node {
get {
return withUnsafeMutablePointers { (target, _) in
unsafeDowncast(bnr_atomic_load_and_wait(target), to: Deferred.Node.self)
bnr_atomic_load_and_wait(target)
}
}
set {
Expand Down

0 comments on commit 9143c15

Please sign in to comment.