Skip to content

Commit

Permalink
use a fieldhash for inside-out storage
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 27, 2014
1 parent 920fb56 commit c7518f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

4.95 2014-04-26
4.95 2014-04-27
- Improved Mojo::IOLoop::Delay with circular reference protection.
- Improved Mojo::IOLoop::Delay to allow argument splicing.
- Improved Mojo::IOLoop::Server to reuse cipher list from IO::Socket::SSL.
Expand Down
8 changes: 3 additions & 5 deletions lib/Mojo/IOLoop/Delay.pm
Expand Up @@ -3,13 +3,11 @@ use Mojo::Base 'Mojo::EventEmitter';

use Mojo;
use Mojo::IOLoop;
use Scalar::Util 'refaddr';
use Hash::Util::FieldHash 'fieldhash';

has ioloop => sub { Mojo::IOLoop->singleton };

my %REMAINING;

sub DESTROY { delete $REMAINING{refaddr shift} }
fieldhash my %REMAINING;

sub begin {
my ($self, $offset, $len) = @_;
Expand All @@ -22,7 +20,7 @@ sub data { shift->Mojo::_dict(data => @_) }

sub pass { $_[0]->begin->(@_) }

sub remaining { $REMAINING{refaddr shift} //= [] }
sub remaining { $REMAINING{shift()} //= [] }

sub steps {
my $self = shift;
Expand Down

0 comments on commit c7518f0

Please sign in to comment.