From: Eric Wong Date: Fri, 10 Jan 2025 23:18:56 +0000 (+0000) Subject: searchidx: move {ntodo} to $self X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05a3408a7f13962b85c1cb40491aabf497b3c2d2;p=thirdparty%2Fpublic-inbox.git searchidx: move {ntodo} to $self Another step towards eliminating the temporary $sync structure to flatten the internal data structures. --- diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index dbbd4323a..daea0bab0 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -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}; }