Skip to content

Commit

Permalink
use a little less code
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 11, 2015
1 parent f3a06f3 commit e6fe5ca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Mojo/Reactor/Poll.pm
Expand Up @@ -46,14 +46,13 @@ sub one_tick {
if (IO::Poll::_poll($timeout, @poll) > 0) {
while (@poll) {
my ($fd, $mode) = (shift(@poll), shift(@poll));

if ($mode & (POLLIN | POLLPRI | POLLHUP | POLLERR)) {
next unless my $io = $self->{io}{$fd};
++$i and $self->_sandbox('Read', $io->{cb}, 0);
}
if ($mode & POLLOUT) {
next unless my $io = $self->{io}{$fd};
++$i and $self->_sandbox('Write', $io->{cb}, 1);
}
next unless $mode & POLLOUT && (my $io = $self->{io}{$fd});
++$i and $self->_sandbox('Write', $io->{cb}, 1);
}
}
}
Expand Down

0 comments on commit e6fe5ca

Please sign in to comment.