]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_xsearch: simplify lei/store import check
authorEric Wong <e@80x24.org>
Thu, 7 Jul 2022 09:40:29 +0000 (09:40 +0000)
committerEric Wong <e@80x24.org>
Thu, 7 Jul 2022 09:47:57 +0000 (09:47 +0000)
There's no need to check for two fields when one will suffice.

lib/PublicInbox/LeiXSearch.pm

index 2958d3f910b0986baa2bccf138ee185ae35b8c7f..41e798562d424b097ec611ef5f283f2251d9563b 100644 (file)
@@ -285,7 +285,7 @@ sub each_remote_eml { # callback for MboxReader->mboxrd
                my ($res, $kw) = $self->{import_sto}->wq_do('add_eml', $eml);
                if (ref($res) eq ref($smsg)) { # totally new message
                        $smsg = $res;
-                       $self->{-imported} = 1;
+                       $self->{-sto_imported} = 1;
                }
                $smsg->{kw} = $kw; # short-circuit xsmsg_vmd
        }
@@ -376,7 +376,7 @@ sub query_remote_mboxrd {
                $fh = IO::Uncompress::Gunzip->new($fh, MultiStream => 1);
                PublicInbox::MboxReader->mboxrd($fh, \&each_remote_eml, $self,
                                                $lei, $each_smsg);
-               if ($self->{import_sto} && delete($self->{-imported})) {
+               if (delete($self->{-sto_imported})) {
                        my $wait = $self->{import_sto}->wq_do('done');
                }
                $reap_curl->join;