assert that the shard count is not 1

This commit is contained in:
Joel Wejdenstål 2023-07-11 05:33:29 +02:00
parent 6616a8d28c
commit 14ada646c5
No known key found for this signature in database
GPG Key ID: DF03CEFBB1A915AA
1 changed files with 1 additions and 1 deletions

View File

@ -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);