Skip to content

Commit

Permalink
small optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 4, 2013
1 parent 14fafc6 commit 251b39c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Mojo/IOLoop/Delay.pm
Expand Up @@ -42,12 +42,11 @@ sub _step {
return $self->{counter} if --$self->{counter} || $self->{step};

# Next step
my $cb = shift @{$self->{steps} ||= []};
$self->{$_} = [] for qw(ordered unordered);
my @args = ((map {@$_} grep {defined} @$ordered), @$unordered);
local $self->{step} = 1;
$self->$cb(@args) if $cb;
$self->emit('finish', @args) unless $self->{counter};
if (my $cb = shift @{$self->{steps} ||= []}) { $self->$cb(@args) }
$self->emit(finish => @args) unless $self->{counter};

return 0;
}
Expand Down

0 comments on commit 251b39c

Please sign in to comment.