From 14f9ea2925de991f74b2a66518a270a3529bebab Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 25 May 2008 18:17:49 -0700 Subject: phash: allow collisions if the hash target is the same If the hash target is the same value, we can permit collisions. This isn't relevant for the current applications of the hash generator, but is useful for cases where one have a number of sources for the same target. It's easy to check, either way. --- perllib/phash.ph | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perllib/phash.ph') diff --git a/perllib/phash.ph b/perllib/phash.ph index 24f6a4f..4efc651 100644 --- a/perllib/phash.ph +++ b/perllib/phash.ph @@ -83,7 +83,7 @@ sub gen_hash_n($$$$) { my $e = ${$href}{$k}; my $xkey; - if (defined($xkey = $edges{$pf})) { + if (defined($xkey = $edges{$pf}) && ${$href}{$xkey} != $e) { if (defined($run)) { print STDERR "$run: Collision: $pf: $k with $xkey\n"; } -- cgit v1.2.3