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 62BB81FC0C for ; Mon, 22 Feb 2021 11:23:00 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 09/10] lei convert: inline convert_start Date: Mon, 22 Feb 2021 08:22:58 -0300 Message-Id: <20210222112259.32402-9-e@80x24.org> In-Reply-To: <20210222112259.32402-1-e@80x24.org> References: <20210222112155.32231-1-e@80x24.org> <20210222112259.32402-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Since we stopped using LeiAuth as a WQ worker, keeping this around as a single-use sub makes no sense and wastes several KB of memory. --- lib/PublicInbox/LeiConvert.pm | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/PublicInbox/LeiConvert.pm b/lib/PublicInbox/LeiConvert.pm index b45de4e0..4839dea4 100644 --- a/lib/PublicInbox/LeiConvert.pm +++ b/lib/PublicInbox/LeiConvert.pm @@ -62,17 +62,6 @@ sub do_convert { # via wq_do delete $self->{wcb}; # commit } -sub convert_start { - my ($lei) = @_; - my $self = $lei->{cnv}; - my $op = $lei->workers_start($self, 'lei_convert', 1, { - '' => [ $lei->can('dclose'), $lei ] - }); - $self->wq_io_do('do_convert', []); - $self->wq_close(1); - while ($op && $op->{sock}) { $op->event_step } -} - sub call { # the main "lei convert" method my ($cls, $lei, @inputs) = @_; my $opt = $lei->{opt}; @@ -131,7 +120,12 @@ sub call { # the main "lei convert" method $nrd->{quiet} = $opt->{quiet}; $lei->{nrd} = $nrd; } - convert_start($lei); + my $op = $lei->workers_start($self, 'lei_convert', 1, { + '' => [ $lei->can('dclose'), $lei ] + }); + $self->wq_io_do('do_convert', []); + $self->wq_close(1); + while ($op && $op->{sock}) { $op->event_step } } sub ipc_atfork_child {