Clarify a comment in constant_hash::generate_table;

This commit is contained in:
Benjamin Bouvier
2019-10-09 17:29:01 +02:00
parent d404368dea
commit 097fa0c7b1

View File

@@ -30,7 +30,8 @@ pub fn generate_table<'cont, T, I: iter::Iterator<Item = &'cont T>, H: Fn(&T) ->
hash_function: H,
) -> Vec<Option<&'cont T>> {
let size = (1.20 * num_items as f64) as usize;
// TODO do we really need the multiply by two here?
// Probing code's stop condition relies on the table having one vacant entry at least.
let size = if size.is_power_of_two() {
size * 2
} else {