From: Tara L Andrews Date: Fri, 20 Apr 2012 08:20:31 +0000 (+0200) Subject: fix exponential loop in common_in_path X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=002e36002a90da00d2fab1e72a0954549dd28dd7;p=scpubgit%2Fstemmatology.git fix exponential loop in common_in_path --- diff --git a/lib/Text/Tradition/Collation.pm b/lib/Text/Tradition/Collation.pm index 3f62b11..a29dacf 100644 --- a/lib/Text/Tradition/Collation.pm +++ b/lib/Text/Tradition/Collation.pm @@ -1806,7 +1806,7 @@ sub _common_in_path { if( $all_seen{$p->id} && $all_seen{$p->id} ne 'r1' ) { # print STDERR "Path candidate $p from $lc\n"; push( @candidates, $p ); - } else { + } elsif( !$all_seen{$p->id} ) { $all_seen{$p->id} = 'r1'; push( @new_lc1, $p ); } @@ -1817,7 +1817,7 @@ sub _common_in_path { if( $all_seen{$p->id} && $all_seen{$p->id} ne 'r2' ) { # print STDERR "Path candidate $p from $lc\n"; push( @candidates, $p ); - } else { + } elsif( !$all_seen{$p->id} ) { $all_seen{$p->id} = 'r2'; push( @new_lc2, $p ); }