]> Sergey Matveev's repositories - public-inbox.git/commitdiff
v2writable: {unindexed} belongs in $sync state
authorEric Wong <e@yhbt.net>
Fri, 24 Jul 2020 05:56:06 +0000 (05:56 +0000)
committerEric Wong <e@yhbt.net>
Sat, 25 Jul 2020 20:48:18 +0000 (20:48 +0000)
There's no reason for {unindexed} to persist beyond
an ->index_sync call.

lib/PublicInbox/V2Writable.pm

index 9a58a7a94123eaee4f03d3f1870bab719d6d3237..f159d39c27f006530c8720760271f24496e85e85 100644 (file)
@@ -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