X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FRoute.pm;h=2c53175fc645b13f4e0f6a6310d97cf7e4f3c8af;hb=a2b44b1c0d70fb3439bef2456a7f950d87e65a0a;hp=d4fb95d4205eae5143959c9c6efd130b0da1eb43;hpb=0bf3741541e019f34e3723649cf487e9982d978d;p=spider.git diff --git a/perl/Route.pm b/perl/Route.pm index d4fb95d4..2c53175f 100644 --- a/perl/Route.pm +++ b/perl/Route.pm @@ -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;