phash.sh: Use int() for the size of the hash table

Pass the hash table size to int() to make it a bit more sane.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2012-03-26 09:25:10 -07:00
parent ff62f33da0
commit c33f05a9c7

View file

@ -146,7 +146,7 @@ sub gen_perfect_hash($) {
# Minimal power of 2 value for N with enough wiggle room.
# The scaling constant must be larger than 0.5 in order for the
# algorithm to ever terminate.
my $room = scalar(@keys)*0.8;
my $room = int(scalar(@keys)*0.8);
$n = 1;
while ($n < $room) {
$n <<= 1;