util: fix panics on updating DelayQueue entries (#3270)

This commit is contained in:
William Bain
2021-01-21 10:56:44 +01:00
committed by GitHub
parent 7d5b12c509
commit c4f66ed121
6 changed files with 96 additions and 18 deletions
+1 -3
View File
@@ -233,14 +233,13 @@ fn slot_for(duration: u64, level: usize) -> usize {
((duration >> (level * 6)) % LEVEL_MULT as u64) as usize
}
/*
#[cfg(all(test, not(loom)))]
mod test {
use super::*;
#[test]
fn test_slot_for() {
for pos in 1..64 {
for pos in 0..64 {
assert_eq!(pos as usize, slot_for(pos, 0));
}
@@ -252,4 +251,3 @@ mod test {
}
}
}
*/