diff options
-rw-r--r-- | users/edef/weave/src/main.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/users/edef/weave/src/main.rs b/users/edef/weave/src/main.rs index e8a1990a0df3..243add9047a5 100644 --- a/users/edef/weave/src/main.rs +++ b/users/edef/weave/src/main.rs @@ -43,9 +43,11 @@ fn main() -> Result<()> { eprint!("… resolve roots\r"); ph_array.par_iter().enumerate().for_each(|(idx, h)| { if let Some(idx_slot) = roots.find(h) { - idx_slot - .compare_exchange(INDEX_NULL, idx as u32, Ordering::SeqCst, Ordering::SeqCst) - .expect("duplicate entry"); + assert_eq!( + idx_slot.swap(idx as u32, Ordering::Relaxed), + INDEX_NULL, + "duplicate entry" + ); } }); eprintln!("{DONE}"); |