From 79a1cc8cecba5a66b3462e7228b2adb37051ad0f Mon Sep 17 00:00:00 2001 From: pp Date: Fri, 28 Apr 2006 15:45:12 +0000 Subject: - pass chains by reference to walk_int git-svn-id: https://siedziba.pl:790/svn/repos/dbxrecover@233 455248ca-bdda-0310-9134-f4ebb693071a --- dbxrecover | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dbxrecover b/dbxrecover index 081556a..6d2f71c 100755 --- a/dbxrecover +++ b/dbxrecover @@ -131,6 +131,7 @@ use warnings; my $self = shift; my $id = shift; my $chain = shift; + my $chains = shift; my $seen = shift; my $combinations = shift; $self->{stats}->{chainsign}++,return if ($combinations > 16); # we don't extract the message if there are too many branches @@ -145,7 +146,7 @@ use warnings; { my $nextchunks = $self->{chunks}->{$chunk->next}; my $nextcount = (ref($nextchunks) eq "ARRAY") ? scalar @{$nextchunks} : 1; - $self->walk_int($chunk->next, $chain, $seen, $combinations * $nextcount); + $self->walk_int($chunk->next, $chain, $chains, $seen, $combinations * $nextcount); } else { @@ -153,7 +154,7 @@ use warnings; my $chainobj = DBX::Chain->new($chain); $self->{stats}->{chainsbroken}++ if $chainobj->broken; $self->{stats}->{chainstot}++; - push @{$self->{chains}}, $chainobj; + push @{$chains}, $chainobj; } pop @{$chain}; } @@ -164,9 +165,9 @@ use warnings; { my $self = shift; my $id = shift; - $self->{chains} = []; - $self->walk_int($id, [], {}, 1); - return $self->{chains}; + my $chains = []; + $self->walk_int($id, [], $chains, {}, 1); + return $chains; } sub stats -- cgit v1.2.3