diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-06-21 17:04:19 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-06-21 17:04:19 -0500 |
commit | fa7ff8c5e7e9ea86a7e44353a1519616afeb3ef8 (patch) | |
tree | 3ef6f6575a81db7f769ad97fe874314c47610e90 | |
parent | 51da33d62c0977d6bcab989abb26db971653022c (diff) | |
download | graph-implicit-fa7ff8c5e7e9ea86a7e44353a1519616afeb3ef8.tar.gz graph-implicit-fa7ff8c5e7e9ea86a7e44353a1519616afeb3ef8.zip |
make the dfs/bfs callback optional
-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 7310cd5..bab96f3 100644 --- a/lib/Graph/Implicit.pm +++ b/lib/Graph/Implicit.pm @@ -107,7 +107,7 @@ sub _traversal { while ($notempty->($bag)) { my ($pred, $vertex) = @{ $remove->($bag) }; if (not exists $marked{$vertex}) { - $code->($pred, $vertex); + $code->($pred, $vertex) if $code; $pred{$vertex} = $pred if defined wantarray; $marked{$vertex} = 1; $insert->($bag, [$vertex, $$_[0]], $$_[1]) for $self->($vertex); |