Skip to content

Instantly share code, notes, and snippets.

/leak.diff Secret

Created March 13, 2015 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/bf8262d50738682cfcb5 to your computer and use it in GitHub Desktop.
Save anonymous/bf8262d50738682cfcb5 to your computer and use it in GitHub Desktop.
diff --git a/lib/Mojo/IOLoop/Delay.pm b/lib/Mojo/IOLoop/Delay.pm
index 33f3541..a9fe61a 100644
--- a/lib/Mojo/IOLoop/Delay.pm
+++ b/lib/Mojo/IOLoop/Delay.pm
@@ -5,9 +5,8 @@ use Mojo::IOLoop;
use Mojo::Util;
use Hash::Util::FieldHash 'fieldhash';
-has ioloop => sub { Mojo::IOLoop->singleton };
-
-fieldhash my %REMAINING;
+has ioloop => sub { Mojo::IOLoop->singleton };
+has remaining => sub { [] };
sub begin {
my ($self, $offset, $len) = @_;
@@ -20,13 +19,6 @@ sub data { Mojo::Util::_stash(data => @_) }
sub pass { $_[0]->begin->(@_) }
-sub remaining {
- my $self = shift;
- return $REMAINING{$self} //= [] unless @_;
- $REMAINING{$self} = shift;
- return $self;
-}
-
sub steps {
my $self = shift->remaining([@_]);
$self->ioloop->next_tick($self->begin);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment