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,AWL,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 307931F92D for ; Fri, 24 Jul 2020 05:56:11 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 20/20] v2writable: {unindexed} belongs in $sync state Date: Fri, 24 Jul 2020 05:56:06 +0000 Message-Id: <20200724055606.27332-21-e@yhbt.net> In-Reply-To: <20200724055606.27332-1-e@yhbt.net> References: <20200724055606.27332-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: There's no reason for {unindexed} to persist beyond an ->index_sync call. --- lib/PublicInbox/V2Writable.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 9a58a7a94..f159d39c2 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -891,12 +891,12 @@ sub reindex_oid ($$$) { } # {unindexed} is unlikely - if ((my $unindexed = $self->{unindexed}) && scalar(@$mids) == 1) { + if ((my $unindexed = $sync->{unindexed}) && scalar(@$mids) == 1) { $num = delete($unindexed->{$mids->[0]}); if (defined $num) { $mid0 = $mids->[0]; $self->{mm}->mid_set($num, $mid0); - delete($self->{unindexed}) if !keys(%$unindexed); + delete($sync->{unindexed}) if !keys(%$unindexed); } } if (!defined($num)) { # reuse if reindexing (or duplicates) @@ -1125,7 +1125,7 @@ sub unindex_oid ($$;$) { # a mirror because the source used -purge or -edit sub unindex ($$$$) { my ($self, $sync, $git, $unindex_range) = @_; - my $unindexed = $self->{unindexed} ||= {}; # $mid0 => $num + my $unindexed = $sync->{unindexed} ||= {}; # $mid0 => $num my $before = scalar keys %$unindexed; # order does not matter, here: my @cmd = qw(log --raw -r