Skip to content

Commit

Permalink
small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 11, 2014
1 parent 6a46010 commit e08e797
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Mojo/IOLoop/Server.pm
Expand Up @@ -51,11 +51,10 @@ sub listen {

# Look for reusable file descriptor
my $address = $args->{address} || '0.0.0.0';
my ($port, $fd);
my $port = $args->{port};
$ENV{MOJO_REUSE} ||= '';
$fd = $1
if ($port = $args->{port})
&& $ENV{MOJO_REUSE} =~ /(?:^|\,)\Q$address:$port\E:(\d+)/;
my $fd;
$fd = $1 if $port && $ENV{MOJO_REUSE} =~ /(?:^|\,)\Q$address:$port\E:(\d+)/;

# Allow file descriptor inheritance
local $^F = 1000;
Expand Down

0 comments on commit e08e797

Please sign in to comment.