11367: minor: Use `compare_exchange_weak` in `limit::Limit::check` r=lnicola a=WaffleLapkin

Not a big deal, but generally loops should use `_weak` version of `compare_exchange`.

Co-authored-by: Maybe Waffle <waffle.lapkin@gmail.com>
This commit is contained in:
bors[bot] 2022-01-28 15:31:52 +00:00 committed by GitHub
commit 6634eaf13a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,7 @@ pub fn check(&self, other: usize) -> Result<(), ()> {
}
if self
.max
.compare_exchange(old_max, other, Ordering::Relaxed, Ordering::Relaxed)
.compare_exchange_weak(old_max, other, Ordering::Relaxed, Ordering::Relaxed)
.is_ok()
{
eprintln!("new max: {}", other);