remove redunant compare of previous and 1
since that's what the compare_exchange does...
This commit is contained in:
parent
785be453f6
commit
f7cc4c93d6
@ -55,7 +55,7 @@ impl HokmaLock {
|
|||||||
.lock
|
.lock
|
||||||
.compare_exchange(1, 1, Ordering::Acquire, Ordering::Relaxed)
|
.compare_exchange(1, 1, Ordering::Acquire, Ordering::Relaxed)
|
||||||
{
|
{
|
||||||
if previous != 1 {
|
// If we failed, previous cannot be 1
|
||||||
return WhenTheHokmaSuppression {
|
return WhenTheHokmaSuppression {
|
||||||
hokma: self,
|
hokma: self,
|
||||||
state: previous,
|
state: previous,
|
||||||
@ -64,7 +64,6 @@ impl HokmaLock {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
struct WhenTheHokmaSuppression {
|
struct WhenTheHokmaSuppression {
|
||||||
hokma: &'static HokmaLock,
|
hokma: &'static HokmaLock,
|
||||||
|
Loading…
Reference in New Issue
Block a user