From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 419761FA18 for ; Mon, 10 Aug 2020 02:12:07 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 10/14] searchidx: use singular `$opt' for consistency with v2 Date: Mon, 10 Aug 2020 02:12:01 +0000 Message-Id: <20200810021205.18909-11-e@yhbt.net> In-Reply-To: <20200810021205.18909-1-e@yhbt.net> References: <20200810021205.18909-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: The rest of our indexing code uses `$opt' instead of `$opts'. --- lib/PublicInbox/SearchIdx.pm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 7f2447fe..5c39f3d6 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -539,11 +539,11 @@ sub unindex_both { # git->cat_async callback # called by public-inbox-index sub index_sync { - my ($self, $opts) = @_; - delete $self->{lock_path} if $opts->{-skip_lock}; - $self->{ibx}->with_umask(\&_index_sync, $self, $opts); - if ($opts->{reindex}) { - my %again = %$opts; + my ($self, $opt) = @_; + delete $self->{lock_path} if $opt->{-skip_lock}; + $self->{ibx}->with_umask(\&_index_sync, $self, $opt); + if ($opt->{reindex}) { + my %again = %$opt; delete @again{qw(rethread reindex)}; index_sync($self, \%again); } @@ -745,15 +745,15 @@ sub reindex_from ($$) { # indexes all unindexed messages (v1 only) sub _index_sync { - my ($self, $opts) = @_; - my $tip = $opts->{ref} || 'HEAD'; + my ($self, $opt) = @_; + my $tip = $opt->{ref} || 'HEAD'; my $git = $self->{ibx}->git; - $self->{batch_bytes} = $opts->{batch_size} // $BATCH_BYTES; + $self->{batch_bytes} = $opt->{batch_size} // $BATCH_BYTES; $git->batch_prepare; - my $pr = $opts->{-progress}; - my $sync = { reindex => $opts->{reindex}, -opt => $opts }; + my $pr = $opt->{-progress}; + my $sync = { reindex => $opt->{reindex}, -opt => $opt }; my $xdb = $self->begin_txn_lazy; - $self->{over}->rethread_prepare($opts); + $self->{over}->rethread_prepare($opt); my $mm = _msgmap_init($self); if ($sync->{reindex}) { my $last = $mm->last_commit;