Skip to content

Commit

Permalink
Fix that Fibonacci hashing doesn't work with a size of 1. It now just…
Browse files Browse the repository at this point in the history
… rounds up to size 2.
  • Loading branch information
skarupke committed Jul 15, 2018
1 parent 812aede commit 2c46874
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flat_hash_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ struct fibonacci_hash_policy

int8_t next_size_over(size_t & size) const
{
size = detailv3::next_power_of_two(size);
size = std::max(size_t(2), detailv3::next_power_of_two(size));
return 64 - detailv3::log2(size);
}
void commit(int8_t shift)
Expand Down

0 comments on commit 2c46874

Please sign in to comment.