aboutsummaryrefslogtreecommitdiff
path: root/std/atomic/queue.zig
diff options
context:
space:
mode:
Diffstat (limited to 'std/atomic/queue.zig')
-rw-r--r--std/atomic/queue.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/std/atomic/queue.zig b/std/atomic/queue.zig
index 142c958173..4f856d9e01 100644
--- a/std/atomic/queue.zig
+++ b/std/atomic/queue.zig
@@ -33,8 +33,8 @@ pub fn Queue(comptime T: type) type {
pub fn get(self: *Self) ?*Node {
var head = @atomicLoad(*Node, &self.head, AtomicOrder.SeqCst);
while (true) {
- const node = head.next ?? return null;
- head = @cmpxchgWeak(*Node, &self.head, head, node, AtomicOrder.SeqCst, AtomicOrder.SeqCst) ?? return node;
+ const node = head.next orelse return null;
+ head = @cmpxchgWeak(*Node, &self.head, head, node, AtomicOrder.SeqCst, AtomicOrder.SeqCst) orelse return node;
}
}
};