]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
cindex: fix --join=reset and speed up incremental joins
authorEric Wong <e@80x24.org>
Fri, 24 Nov 2023 09:53:46 +0000 (09:53 +0000)
committerEric Wong <e@80x24.org>
Sat, 25 Nov 2023 00:10:11 +0000 (00:10 +0000)
`reset' means we want to ignore existing join data, while
the default (non-reset) means we perform an incremental
join while taking into account existing (fuzzy) join data.

lib/PublicInbox/CodeSearchIdx.pm

index 3a551c840f547491d640ec761bd6971dd460b902..81ca5cbc88beb9e51e60798759e0b7f6f32cf5ba 100644 (file)
@@ -997,7 +997,7 @@ sub init_join_postfork ($) {
        require_progs('join', join => \@JOIN);
        my $d2 = '([0-9]{2})';
        my $dt_re = qr!([0-9]{4})$d2$d2$d2$d2$d2!;
-       if (my $cur = $JOIN{reset} ? current_join_data($self) : undef) {
+       if (my $cur = $JOIN{reset} ? undef : current_join_data($self)) {
                if (($cur->{dt}->[1] // '') =~ m!\A$dt_re\z!o) {
                        my ($Y, $m, $d, $H, $M, $S) = ($1, $2, $3, $4, $5, $6);
                        my $t = timegm($S, $M, $H, $d, $m - 1, $Y);