diff options
author | doy <doy@tozt.net> | 2008-12-14 19:13:22 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2008-12-14 19:13:22 -0500 |
commit | 39db27488e0e5157df81c2c9b67c89f184438868 (patch) | |
tree | f7a811b648234b5c7420d747ccd43151b3f9dcd8 | |
parent | b0cf5205e0abbf2c6fd4014755d9e304bf7bd34a (diff) | |
download | graph-implicit-39db27488e0e5157df81c2c9b67c89f184438868.tar.gz graph-implicit-39db27488e0e5157df81c2c9b67c89f184438868.zip |
don't build the %pred hash if we aren't going to use it
-rw-r--r-- | lib/Graph/Implicit.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Graph/Implicit.pm b/lib/Graph/Implicit.pm index 03b9ebb..50f7207 100644 --- a/lib/Graph/Implicit.pm +++ b/lib/Graph/Implicit.pm @@ -58,7 +58,7 @@ sub _traversal { my ($pred, $vertex) = @{ $remove->(\@bag) }; if (not exists $marked{$vertex}) { $code->($pred, $vertex); - $pred{$vertex} = $pred; + $pred{$vertex} = $pred if defined wantarray; $marked{$vertex} = 1; $insert->(\@bag, $_) for $self->neighbors($vertex); } |