]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchidx: remove_message: pedantic fix for v1
authorEric Wong <e@80x24.org>
Fri, 3 Jan 2020 08:46:03 +0000 (08:46 +0000)
committerEric Wong <e@80x24.org>
Sat, 4 Jan 2020 09:35:05 +0000 (09:35 +0000)
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

index ca1457fd437d3022f0733ce7e908c0d27e6e0786..0d983aabdc9825044ec9cdbe1b6fafd21a2e7779 100644 (file)
@@ -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 ($@) {