Subject: | Infinite loop in new() |
while( $buckets_per_waight < 5 ){
$self->{mask} = (($self->{mask} << 2) | 3);
}
If buckets_per_waight < 5 before this code block, it will remain < 5 .
This is demonstrable with:
my(@targets) = (1..100);
my $chash = Hash::ConsistentHash->new(
buckets => \@targets,
hash_func => \&crc32
);