From c33f05a9c7e2975d80bcb9cb4ea948bb00805f0c Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 26 Mar 2012 09:25:10 -0700 Subject: 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 --- perllib/phash.ph | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perllib/phash.ph b/perllib/phash.ph index 936978a..8142c4e 100644 --- a/perllib/phash.ph +++ b/perllib/phash.ph @@ -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; -- cgit v1.2.3