Skip to content

Commit

Permalink
no need to preserve the value
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 11, 2015
1 parent dd9ea0b commit 3bbe73c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/Mojo/Reactor/Poll.pm
Expand Up @@ -22,9 +22,8 @@ sub is_running { !!shift->{running} }
sub one_tick {
my $self = shift;

# Remember state for later
my $running = $self->{running};
$self->{running} = 1;
# Just one tick
local $self->{running} = 1 unless $self->{running};

# Wait for one event
my $i;
Expand Down Expand Up @@ -74,9 +73,6 @@ sub one_tick {
++$i and $self->_sandbox("Timer $id", $t->{cb}) if $t->{cb};
}
}

# Restore state if necessary
$self->{running} = $running if $self->{running};
}

sub recurring { shift->_timer(1, @_) }
Expand Down

0 comments on commit 3bbe73c

Please sign in to comment.