Skip to content

Commit

Permalink
small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 17, 2013
1 parent 1b324bf commit 17afad4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Changes
@@ -1,10 +1,10 @@

4.15 2013-06-17
4.15 2013-06-18
- Improved router to make the current controller object available to actions
as $_. (jberger, sri)
- Fixed a few error reporting bugs in Mojo::IOLoop::Client and
Mojo::IOLoop::Server.
- Fixed small chained hook bug.
- Fixed small emit_chain bug in Mojolicious::Plugins.

4.14 2013-06-10
- Improved url_for performance slightly.
Expand Down
5 changes: 2 additions & 3 deletions lib/Mojolicious/Routes.pm
Expand Up @@ -146,7 +146,6 @@ sub _controller {
unless ($new = $self->_class($old, $field)) { return !!defined $new }

# Application
my $continue;
my $class = ref $new;
my $log = $old->app->log;
if (my $sub = $new->can('handler')) {
Expand All @@ -168,15 +167,15 @@ sub _controller {

if (my $sub = $new->can($method)) {
$old->stash->{'mojo.routed'}++ unless $nested;
$continue = $sub->(local $_ = $new);
return 1 if $sub->(local $_ = $new);
}

else { $log->debug('Action not found in controller.') }
}
else { $log->debug(qq{Action "$method" is not allowed.}) }
}

return !$nested || $continue;
return !$nested;
}

sub _load {
Expand Down

0 comments on commit 17afad4

Please sign in to comment.