From: Brandon L Black Date: Thu, 9 Nov 2006 22:44:23 +0000 (+0000) Subject: this passes all 5 inf loop tests X-Git-Tag: 0.06~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3d42306bb81cc57f592db7ea410e7c924166c0f9;p=gitmo%2FAlgorithm-C3.git this passes all 5 inf loop tests --- diff --git a/lib/Algorithm/C3.pm b/lib/Algorithm/C3.pm index 00250c9..f1d9781 100644 --- a/lib/Algorithm/C3.pm +++ b/lib/Algorithm/C3.pm @@ -48,7 +48,6 @@ sub merge { $i = 0; next; } - %seen = (); my $mergeout = $cache->{merge}->{$current_root} ||= do { @@ -94,6 +93,8 @@ sub merge { return @$mergeout if !@STACK; + $seen{$current_root}--; + ($current_root, $current_parents, $recurse_mergeout, $i) = @{pop @STACK};