Skip to content

Commit d11d61b

Browse files
refactor: simplify unnecessary comparison with boolean literal
Expressions of the form `x == true`, `!y == false` are unnecessary. Consider using the variable directly.
1 parent 810f5e0 commit d11d61b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ impl Spinlock {
1212
}
1313

1414
pub fn lock(&self) {
15-
while self.lock.compare_and_swap(false, true, Ordering::Acquire) != false {}
15+
while !self.lock.compare_and_swap(false, true, Ordering::Acquire) {}
1616
}
1717

1818
pub fn unlock(&self) {

0 commit comments

Comments
 (0)