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 10D1D1F9FF for ; Fri, 19 Feb 2021 12:09:57 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/6] lei_to_mail: get rid of empty _post_augment_maildir Date: Fri, 19 Feb 2021 05:09:51 -0700 Message-Id: <20210219120955.13891-3-e@80x24.org> In-Reply-To: <20210219120955.13891-1-e@80x24.org> References: <20210219120955.13891-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We won't have _post_augment_imap when we add IMAP support, either. _pre_augment_imap will not exist, either, since opening an IMAP(S) connection can be time consuming so we'll roll that into imap_common_init. --- lib/PublicInbox/LeiToMail.pm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm index b90756ae..e89cca71 100644 --- a/lib/PublicInbox/LeiToMail.pm +++ b/lib/PublicInbox/LeiToMail.pm @@ -394,8 +394,6 @@ sub _do_augment_maildir { } } -sub _post_augment_maildir {} # noop - sub _pre_augment_mbox { my ($self, $lei) = @_; my $dst = $lei->{ovv}->{dst}; @@ -441,8 +439,8 @@ sub _do_augment_mbox { sub pre_augment { # fast (1 disk seek), runs in same process as post_augment my ($self, $lei) = @_; # _pre_augment_maildir, _pre_augment_mbox - my $m = "_pre_augment_$self->{base_type}"; - $self->$m($lei); + my $m = $self->can("_pre_augment_$self->{base_type}") or return; + $m->($self, $lei); } sub do_augment { # slow, runs in wq worker @@ -455,9 +453,9 @@ sub do_augment { # slow, runs in wq worker # fast (spawn compressor or mkdir), runs in same process as pre_augment sub post_augment { my ($self, $lei, @args) = @_; - # _post_augment_maildir, _post_augment_mbox - my $m = "_post_augment_$self->{base_type}"; - $self->$m($lei, @args); + # _post_augment_mbox + my $m = $self->can("_post_augment_$self->{base_type}") or return; + $m->($self, $lei, @args); } sub ipc_atfork_child {