]> Sergey Matveev's repositories - public-inbox.git/commitdiff
v2writable: go backwards through alternate Message-IDs
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Fri, 30 Mar 2018 01:20:44 +0000 (01:20 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Fri, 30 Mar 2018 01:21:09 +0000 (01:21 +0000)
This is consistent with how we internally generate new
Message-IDs to break conflicts and allows ->reindex to
succeed while walking backwards through history

lib/PublicInbox/V2Writable.pm

index 269b028f5373a9fb1e99ed7c2b8166c438c6d111..34f13e26cb2531ebda1da78266357f5c00aa01d2 100644 (file)
@@ -137,7 +137,7 @@ sub num_for {
                warn "<$mid> reused for mismatched content\n";
 
                # try the rest of the mids
-               foreach my $i (1..$#$mids) {
+               for(my $i = $#$mids; $i >= 1; $i--) {
                        my $m = $mids->[$i];
                        $num = $self->{skel}->{mm}->mid_insert($m);
                        if (defined $num) {