summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-03-26 09:25:10 -0700
committerH. Peter Anvin <hpa@zytor.com>2012-03-26 09:25:10 -0700
commitc33f05a9c7e2975d80bcb9cb4ea948bb00805f0c (patch)
tree9de8aec6489f80280ba8724f27f46a165d181b21
parentff62f33da0a283e05f4855e8d18449c0117c43c3 (diff)
downloadnasm-c33f05a9c7e2975d80bcb9cb4ea948bb00805f0c.tar.gz
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>
-rw-r--r--perllib/phash.ph2
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/phash.ph b/perllib/phash.ph
index 936978a5..8142c4ef 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;