]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
searchidx: move {ntodo} to $self
authorEric Wong <e@80x24.org>
Fri, 10 Jan 2025 23:18:56 +0000 (23:18 +0000)
committerEric Wong <e@80x24.org>
Tue, 14 Jan 2025 04:45:33 +0000 (04:45 +0000)
Another step towards eliminating the temporary $sync structure
to flatten the internal data structures.

lib/PublicInbox/SearchIdx.pm

index dbbd4323a799d6459d8e915557eb7fc97e209dfa..daea0bab047a1f89e8367717700893ea196265b8 100644 (file)
@@ -894,7 +894,7 @@ sub v1_checkpoint ($$;$) {
        idx_release($self, $nrec);
        # let another process do some work...
        if (my $pr = $self->{-opt}->{-progress}) {
-               $pr->("indexed $nrec/$sync->{ntodo}\n") if $nrec;
+               $pr->("indexed $nrec/$self->{ntodo}\n") if $nrec;
        }
        if (!$stk && !$self->{quit}) { # more to come
                begin_txn_lazy($self);
@@ -1107,8 +1107,8 @@ sub _index_sync {
        my $range = $lx eq '' ? $tip : "$lx..$tip";
        $pr->("counting changes\n\t$range ... ") if $pr;
        my $stk = prepare_stack($self, $sync, $range);
-       $sync->{ntodo} = $stk ? $stk->num_records : 0;
-       $pr->("$sync->{ntodo}\n") if $pr; # continue previous line
+       local $self->{ntodo} = $stk ? $stk->num_records : 0;
+       $pr->("$self->{ntodo}\n") if $pr; # continue previous line
        v1_process_stack($self, $sync, $stk) if !$self->{quit};
 }