From bfc3c59891a5135c6721921198f618776f2f1f82 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 10 Jan 2025 23:20:05 +0000 Subject: [PATCH] v2writable: eliminate $sync->{art_end} Instead of creating a long-lived {art_end} entry or even local-izing it in $self, pass the `$art_end' value on stack to achieve symmetry with the existing `$arg_beg' arg in calls to index_xap_step(). --- lib/PublicInbox/V2Writable.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 0606c99f3..4e42b347a 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -1095,9 +1095,8 @@ sub index_xap_only { # git->cat_async callback $idx->index_eml(PublicInbox::Eml->new($bref), $smsg); } -sub index_xap_step ($$$;$) { - my ($self, $sync, $beg, $step) = @_; - my $end = $sync->{art_end}; +sub index_xap_step ($$$$;$) { + my ($self, $sync, $beg, $end, $step) = @_; return if $beg > $end; # nothing to do $step //= $self->{shards}; @@ -1177,18 +1176,18 @@ sub xapian_only ($;$$) { if (my $art_end = $self->{ibx}->mm->max) { $self->{-regen_fmt} //= "%u/?\n"; $sync //= { self => $self }; - $sync->{art_end} = $art_end; if ($seq || !$self->{parallel}) { my $shard_end = $self->{shards} - 1; for my $i (0..$shard_end) { last if $self->{quit}; - index_xap_step($self, $sync, $art_beg + $i); + index_xap_step $self, $sync, $art_beg + $i, + $art_end; if ($i != $shard_end) { reindex_checkpoint($self, $sync); } } } else { # parallel (maybe) - index_xap_step($self, $sync, $art_beg, 1); + index_xap_step $self, $sync, $art_beg, $art_end, 1; } } $self->git->async_wait_all; -- 2.47.3