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 7C8261FA18 for ; Mon, 7 Dec 2020 07:40:54 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 5/5] shard_add_eidx_info: pass $eidx_key instead of $ibx object Date: Mon, 7 Dec 2020 07:40:53 +0000 Message-Id: <20201207074053.14483-6-e@80x24.org> In-Reply-To: <20201207074053.14483-1-e@80x24.org> References: <20201207074053.14483-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This improves consistency with sibling methods such as ->shard_remove_eidx_info and ->add_xref3. Passing the $eidx_key scalar is preferable to the entire $ibx object for IPC-friendliness. --- lib/PublicInbox/ExtSearchIdx.pm | 2 +- lib/PublicInbox/SearchIdxShard.pm | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm index c06b25a9..c82d1633 100644 --- a/lib/PublicInbox/ExtSearchIdx.pm +++ b/lib/PublicInbox/ExtSearchIdx.pm @@ -125,7 +125,7 @@ sub do_xpost ($$) { if (my $new_smsg = $req->{new_smsg}) { # 'm' on cross-posted message my $xnum = $req->{xnum}; $self->{oidx}->add_xref3($docid, $xnum, $oid, $eidx_key); - $idx->shard_add_eidx_info($docid, $xibx, $eml); + $idx->shard_add_eidx_info($docid, $eidx_key, $eml); check_batch_limit($req); } else { # 'd' my $rm_eidx_info; diff --git a/lib/PublicInbox/SearchIdxShard.pm b/lib/PublicInbox/SearchIdxShard.pm index 182bbde2..579ed196 100644 --- a/lib/PublicInbox/SearchIdxShard.pm +++ b/lib/PublicInbox/SearchIdxShard.pm @@ -144,8 +144,7 @@ sub index_raw { } sub shard_add_eidx_info { - my ($self, $docid, $xibx, $eml) = @_; - my $eidx_key = $xibx->eidx_key; + my ($self, $docid, $eidx_key, $eml) = @_; if (my $w = $self->{w}) { my $hdr = $eml->header_obj->as_string; my $len = length($hdr);