From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id BD1E21F92B for ; Sun, 5 Jul 2020 23:28:10 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 25/43] remove unused/redundant zlib-related imports Date: Sun, 5 Jul 2020 23:27:41 +0000 Message-Id: <20200705232759.3161-26-e@yhbt.net> In-Reply-To: <20200705232759.3161-1-e@yhbt.net> References: <20200705232759.3161-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Z_FINISH is the default for Compress::Raw::Zlib::Deflate->flush, anyways, so there's no reason to import it. And none of C::R::Z is needed in WwwText now that gzf_maybe handles it all. --- lib/PublicInbox/GzipFilter.pm | 6 +++--- lib/PublicInbox/WwwText.pm | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/GzipFilter.pm b/lib/PublicInbox/GzipFilter.pm index 99d43cf04..6380f50e9 100644 --- a/lib/PublicInbox/GzipFilter.pm +++ b/lib/PublicInbox/GzipFilter.pm @@ -5,7 +5,7 @@ package PublicInbox::GzipFilter; use strict; use parent qw(Exporter); -use Compress::Raw::Zlib qw(Z_FINISH Z_OK); +use Compress::Raw::Zlib qw(Z_OK); use PublicInbox::CompressNoop; use PublicInbox::Eml; use PublicInbox::GitAsyncCat; @@ -95,7 +95,7 @@ sub translate ($$) { $self->{zbuf} = $zbuf; ''; } else { # undef == EOF - my $err = $gz->flush($zbuf, Z_FINISH); + my $err = $gz->flush($zbuf); die "gzip->flush: $err" if $err != Z_OK; $zbuf; } @@ -125,7 +125,7 @@ sub zflush ($;$) { $err = $gz->deflate($_[1], $zbuf); die "gzip->deflate: $err" if $err != Z_OK; } - $err = $gz->flush($zbuf, Z_FINISH); + $err = $gz->flush($zbuf); die "gzip->flush: $err" if $err != Z_OK; $zbuf; } diff --git a/lib/PublicInbox/WwwText.pm b/lib/PublicInbox/WwwText.pm index ea50428e3..08691684d 100644 --- a/lib/PublicInbox/WwwText.pm +++ b/lib/PublicInbox/WwwText.pm @@ -11,7 +11,6 @@ use PublicInbox::WwwStream; use PublicInbox::Hval qw(ascii_html); use URI::Escape qw(uri_escape_utf8); use PublicInbox::GzipFilter qw(gzf_maybe); -use Compress::Raw::Zlib qw(Z_FINISH Z_OK); our $QP_URL = 'https://xapian.org/docs/queryparser.html'; our $WIKI_URL = 'https://en.wikipedia.org/wiki'; my $hl = eval {