Skip to content

Commit

Permalink
Made get_node private
Browse files Browse the repository at this point in the history
  • Loading branch information
Leont committed Apr 15, 2015
1 parent dcf0173 commit f8dc2f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/Build/Graph.pm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ sub run_subst {
return $subst_action->(@args);
}

sub get_node {
sub _get_node {
my ($self, $key) = @_;
return $self->{nodes}{$key};
}
Expand Down Expand Up @@ -130,7 +130,7 @@ $node_sorter = sub {
Carp::croak("$current has a circular dependency, aborting!\n") if exists $loop->{$current};
return if $seen->{$current}++;
local $loop->{$current} = 1;
if (my $node = $self->get_node($current)) {
if (my $node = $self->_get_node($current)) {
$self->$node_sorter($_, $callback, $seen, $loop) for $self->expand({}, $node->dependencies);
$callback->($current, $node);
}
Expand All @@ -155,7 +155,7 @@ sub _sort_nodes {

sub to_hashref {
my $self = shift;
my %nodes = map { $_ => $self->get_node($_)->to_hashref } keys %{ $self->{nodes} };
my %nodes = map { $_ => $self->_get_node($_)->to_hashref } keys %{ $self->{nodes} };
my %variables = map { $_ => $self->{variables}{$_}->to_hashref } keys %{ $self->{variables} };
my @plugins = map { $_->to_hashref } sort { $a->{counter} <=> $b->{counter} } values %{ $self->{plugins} };
return {
Expand Down
2 changes: 1 addition & 1 deletion lib/Build/Graph/Node/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sub run {
my $filename = $self->name;

my $graph = $self->{graph};
my @files = grep { $graph->get_node($_) && $graph->get_node($_)->isa(__PACKAGE__) || -e } $graph->expand({}, $self->dependencies);
my @files = grep { $graph->_get_node($_) && $graph->_get_node($_)->isa(__PACKAGE__) || -e } $graph->expand({}, $self->dependencies);

return if -e $filename and sub { -d or -M $filename <= -M or return 0 for @files; 1 }->();

Expand Down

0 comments on commit f8dc2f5

Please sign in to comment.