Skip to content

Commit

Permalink
small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 29, 2013
1 parent 99a43a0 commit db56c8a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/Mojolicious/Routes.pm
Expand Up @@ -38,10 +38,9 @@ sub continue {
my $stash = $c->stash;
@{$stash}{@keys} = @{$stash->{'mojo.captures'}}{@keys} = values %$field;

my $continue
= $field->{cb}
? $self->_callback($c, $field, $last)
: $self->_controller($c, $field, $last);
my $continue;
if (my $cb = $field->{cb}) { $continue = $self->_callback($c, $cb, $last) }
else { $continue = $self->_controller($c, $field, $last) }
$match->current($current);

# Break the chain
Expand Down Expand Up @@ -120,11 +119,11 @@ sub _add {
}

sub _callback {
my ($self, $c, $field, $last) = @_;
my ($self, $c, $cb, $last) = @_;
$c->stash->{'mojo.routed'}++ if $last;
my $app = $c->app;
$app->log->debug('Routing to a callback.');
return _action($app, $c, $field->{cb}, $last);
return _action($app, $c, $cb, $last);
}

sub _class {
Expand Down

0 comments on commit db56c8a

Please sign in to comment.