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-ASN: 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 50F9E1F5A2 for ; Fri, 3 Jan 2020 08:46:04 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 6/6] searchidx: remove_message: pedantic fix for v1 Date: Fri, 3 Jan 2020 08:46:03 +0000 Message-Id: <20200103084603.8405-7-e@80x24.org> In-Reply-To: <20200103084603.8405-1-e@80x24.org> References: <20200103084603.8405-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It shouldn't be possible for v1 inboxes to have multiple matches for a given Message-ID, so the sub would only get called once, but strange things could happen in 2112 :> --- lib/PublicInbox/SearchIdx.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index ca1457fd..0d983aab 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -433,7 +433,7 @@ sub remove_message { batch_do($self, 'Q' . $mid, sub { my ($ids) = @_; $db->delete_document($_) for @$ids; - $nr = scalar @$ids; + $nr += scalar @$ids; }); }; if ($@) {