mirror of https://github.com/xacrimon/dashmap
assert that the shard count is not 1
This commit is contained in:
parent
6616a8d28c
commit
14ada646c5
|
@ -270,7 +270,7 @@ impl<'a, K: 'a + Eq + Hash, V: 'a, S: BuildHasher + Clone> DashMap<K, V, S> {
|
|||
hasher: S,
|
||||
shard_amount: usize,
|
||||
) -> Self {
|
||||
assert!(shard_amount > 0);
|
||||
assert!(shard_amount > 1);
|
||||
assert!(shard_amount.is_power_of_two());
|
||||
|
||||
let shift = util::ptr_size_bits() - ncb(shard_amount);
|
||||
|
|
Loading…
Reference in New Issue