]> dxcluster.org Git - spider.git/commitdiff
try to stop Route::findroutes recursing too much
authorDirk Koopman <djk@tobit.co.uk>
Sat, 23 Jun 2007 22:50:10 +0000 (23:50 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Sat, 23 Jun 2007 22:50:10 +0000 (23:50 +0100)
perl/Route.pm
perl/Version.pm

index d4fb95d4205eae5143959c9c6efd130b0da1eb43..2c53175fc645b13f4e0f6a6310d97cf7e4f3c8af 100644 (file)
@@ -305,9 +305,11 @@ sub findroutes
        # deal with more nodes
        my $nref = Route::get($call);
        foreach my $ncall (@{$nref->{parent}}) {
-               dbg("recursing from $call -> $ncall") if isdbg('routec');
-               my @rout = findroutes($ncall, $level+1, $seen);
-               push @out, @rout;
+               unless ($seen->{$ncall}) {
+                       dbg("recursing from $call -> $ncall") if isdbg('routec');
+                       my @rout = findroutes($ncall, $level+1, $seen);
+                       push @out, @rout;
+               }
        }
 
        return $level == 0 ? map {$_->[1]} sort {$a->[0] <=> $b->[0]} @out : @out;
index a4aaf1cb31b4447b7192280932dec08c6bdb3335..b0305ac96d1f8b3b32e5ca127d208db6923743a3 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.54';
 $subversion = '0';
-$build = '73';
+$build = '74';
 
 1;