Skip to content

Commit

Permalink
return an empty list if the return value is significant
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 21, 2015
1 parent d1b9ff5 commit d040ec4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Mojo/DOM.pm
Expand Up @@ -209,7 +209,7 @@ sub _all_text {
sub _ancestors {
my ($self, $root) = @_;

return unless my $tree = $self->_parent;
return () unless my $tree = $self->_parent;
my @ancestors;
do { push @ancestors, $tree }
while ($tree->[0] eq 'tag') && ($tree = $tree->[3]);
Expand Down Expand Up @@ -265,7 +265,7 @@ sub _link {
sub _maybe { $_[1] ? $_[0]->_build($_[1], $_[0]->xml) : undef }

sub _nodes {
return unless my $tree = shift;
return () unless my $tree = shift;
my @nodes = @$tree[_start($tree) .. $#$tree];
return shift() ? grep { $_->[0] eq 'tag' } @nodes : @nodes;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Renderer.pm
Expand Up @@ -129,7 +129,7 @@ sub render {
# Template or templateless handler
else {
$options->{template} ||= $self->template_for($c);
return unless $self->_render_template($c, \$output, $options);
return () unless $self->_render_template($c, \$output, $options);
}

# Inheritance
Expand Down

0 comments on commit d040ec4

Please sign in to comment.