From a2b44b1c0d70fb3439bef2456a7f950d87e65a0a Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Sat, 23 Jun 2007 23:50:10 +0100 Subject: [PATCH] try to stop Route::findroutes recursing too much --- perl/Route.pm | 8 +++++--- perl/Version.pm | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) 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; diff --git a/perl/Version.pm b/perl/Version.pm index a4aaf1cb..b0305ac9 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.54'; $subversion = '0'; -$build = '73'; +$build = '74'; 1; -- 2.43.0