Skip to content

Commit

Permalink
slightly more consistent use of flags
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 25, 2015
1 parent ce7a188 commit 0ed85b1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/IOLoop.pm
Expand Up @@ -169,7 +169,7 @@ sub _accepting {
# Check if multi-accept is desirable
my $multi = $self->multi_accept;
$_->multi_accept($max < $multi ? 1 : $multi)->start for values %$acceptors;
$self->{accepting}++;
$self->{accepting} = 1;
}

sub _id {
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Prefork.pm
Expand Up @@ -84,7 +84,7 @@ sub run {
while ((my $pid = waitpid -1, WNOHANG) > 0) {
next unless my $w = delete $self->emit(reap => $pid)->{pool}{$pid};
$self->app->log->debug("Worker $pid stopped.");
$self->{finished}++ unless $w->{healthy};
$self->{finished} = 1 unless $w->{healthy};
}
};
local $SIG{QUIT} = sub { $self->_term(1) };
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojolicious/Routes.pm
Expand Up @@ -111,7 +111,7 @@ sub _add {

sub _callback {
my ($self, $c, $cb, $last) = @_;
$c->stash->{'mojo.routed'}++ if $last;
$c->stash->{'mojo.routed'} = 1 if $last;
my $app = $c->app;
$app->log->debug('Routing to a callback.');
return _action($app, $c, $cb, $last);
Expand Down Expand Up @@ -176,7 +176,7 @@ sub _controller {
weaken $r->parent($old->match->endpoint)->{parent} unless $r->parent;
}
$new->handler($old);
$old->stash->{'mojo.routed'}++;
$old->stash->{'mojo.routed'} = 1;
}

# Action
Expand All @@ -185,7 +185,7 @@ sub _controller {
$log->debug(qq{Routing to controller "$class" and action "$method".});

if (my $sub = $new->can($method)) {
$old->stash->{'mojo.routed'}++ if $last;
$old->stash->{'mojo.routed'} = 1 if $last;
return 1 if _action($app, $new, $sub, $last);
}

Expand All @@ -206,7 +206,7 @@ sub _load {

# Check base classes
return 0 unless first { $app->isa($_) } @{$self->base_classes};
return ++$self->{loaded}{$app};
return $self->{loaded}{$app} = 1;
}

1;
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Static.pm
Expand Up @@ -34,7 +34,7 @@ sub dispatch {

# Serve static file and prevent directory traversal
return undef if $parts[0] eq '..' || !$self->serve($c, join('/', @parts));
$stash->{'mojo.static'}++;
$stash->{'mojo.static'} = 1;
return !!$c->rendered;
}

Expand Down

0 comments on commit 0ed85b1

Please sign in to comment.