Skip to content

Commit

Permalink
return a little earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 9, 2014
1 parent bc434db commit 09fb6e7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Mojolicious/Renderer.pm
Expand Up @@ -75,9 +75,8 @@ sub get_helper {
return $helpers->{$name} if $helpers->{$name};

my $lookup = $self->{lookup} ||= {};
$lookup->{$name} = 1
if $lookup->{$name} || grep { $_ =~ /^\Q$name\E\./ } keys %$helpers;
return undef unless $lookup->{$name};
return undef unless $lookup->{$name} || grep {/^\Q$name\E\./} keys %$helpers;
$lookup->{$name} = 1;
return sub {
Mojolicious::Renderer::Helpers->new(controller => shift, prefix => $name);
};
Expand Down

0 comments on commit 09fb6e7

Please sign in to comment.