diff options
author | Eric Wong <e@80x24.org> | 2022-09-10 08:17:17 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2022-09-10 19:50:46 +0000 |
commit | 3b3ee0a9d98e338c94d8ec90191bbe76faba0d87 (patch) | |
tree | 5410623e9a0381ba2d1840cf0de8f15b10ac2137 /lib/PublicInbox/GzipFilter.pm | |
parent | dc5314822113431d90dd0c65d3a1a22ea31f7c3b (diff) | |
download | public-inbox-3b3ee0a9d98e338c94d8ec90191bbe76faba0d87.tar.gz |
This may help us identify hot spots and reduce pad space as needed.
Diffstat (limited to 'lib/PublicInbox/GzipFilter.pm')
-rw-r--r-- | lib/PublicInbox/GzipFilter.pm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/PublicInbox/GzipFilter.pm b/lib/PublicInbox/GzipFilter.pm index 77d570b6..eb0046ce 100644 --- a/lib/PublicInbox/GzipFilter.pm +++ b/lib/PublicInbox/GzipFilter.pm @@ -130,11 +130,11 @@ sub write { # similar to ->translate; use this when we're sure we know we have # more data to buffer after this sub zmore { - my $self = $_[0]; # $_[1] => input + my $self = shift; # $_[1] => input http_out($self); my $err; - for (delete $self->{obuf}, @_[1..$#_]) { - $err = $self->{gz}->deflate($_ // next, $self->{zbuf}); + for (@_) { + $err = $self->{gz}->deflate($_, $self->{zbuf}); die "gzip->deflate: $err" if $err != Z_OK; } undef; @@ -142,13 +142,12 @@ sub zmore { # flushes and returns the final bit of gzipped data sub zflush ($;@) { - my $self = $_[0]; # $_[1..Inf] => final input (optional) + my $self = shift; # $_[1..Inf] => final input (optional) my $zbuf = delete $self->{zbuf}; my $gz = delete $self->{gz}; my $err; - # it's a bug iff $gz is undef w/ $obuf or $_[1..] - for (delete $self->{obuf}, @_[1..$#_]) { - $err = $gz->deflate($_ // next, $zbuf); + for (@_) { # it's a bug iff $gz is undef if @_ isn't empty, here: + $err = $gz->deflate($_, $zbuf); die "gzip->deflate: $err" if $err != Z_OK; } $gz // return ''; # not a bug, recursing on DS->write failure |