Skip to content

Commit

Permalink
small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 27, 2013
1 parent 457572f commit e0e95d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Mojo/IOLoop/Stream.pm
Expand Up @@ -13,7 +13,9 @@ has timeout => 15;

sub DESTROY { shift->close }

sub new { shift->SUPER::new(handle => shift, buffer => '') }
sub new {
shift->SUPER::new(handle => shift, buffer => '', active => steady_time);
}

sub close {
my $self = shift;
Expand Down Expand Up @@ -100,7 +102,6 @@ sub _startup {

# Timeout (ignore 0 timeout)
my $reactor = $self->reactor;
$self->{active} = steady_time;
weaken $self;
$self->{timer} = $reactor->recurring(
0.5 => sub {
Expand Down

0 comments on commit e0e95d5

Please sign in to comment.