Removed unnecessary return switch on void method

Removed an unnecessary "return switch" on the Atomic.store method
This commit is contained in:
Zachary Raineri 2023-06-24 00:12:07 -05:00 committed by GitHub
parent 5288929ffd
commit 148e2a5a89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,11 +82,11 @@ pub fn Atomic(comptime T: type) type {
}
pub inline fn store(self: *Self, value: T, comptime ordering: Ordering) void {
return switch (ordering) {
switch (ordering) {
.AcqRel => @compileError(@tagName(ordering) ++ " implies " ++ @tagName(Ordering.Acquire) ++ " which is only allowed on atomic loads"),
.Acquire => @compileError(@tagName(ordering) ++ " is only allowed on atomic loads"),
else => @atomicStore(T, &self.value, value, ordering),
};
}
}
pub inline fn swap(self: *Self, value: T, comptime ordering: Ordering) T {