- pass chains by reference to walk_int

pp [2006-04-28 15:45:12]
- pass chains by reference to walk_int


git-svn-id: https://siedziba.pl:790/svn/repos/dbxrecover@233 455248ca-bdda-0310-9134-f4ebb693071a
Filename
dbxrecover
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
ViewGit