* [PATCH] extindex: avoid branch
@ 2024-05-31 10:15 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2024-05-31 10:15 UTC (permalink / raw)
To: spew
---
lib/PublicInbox/ExtSearchIdx.pm | 6 ++++--
lib/PublicInbox/SearchIdxShard.pm | 3 +--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm
index 934197c0..68700c8b 100644
--- a/lib/PublicInbox/ExtSearchIdx.pm
+++ b/lib/PublicInbox/ExtSearchIdx.pm
@@ -245,7 +245,8 @@ sub index_unseen ($) {
my $oid = $new_smsg->{blob};
my $ibx = delete $req->{ibx} or die 'BUG: {ibx} unset';
$self->{oidx}->add_xref3($docid, $req->{xnum}, $oid, $ibx->eidx_key);
- $idx->index_eml($eml, $new_smsg, $ibx->eidx_key);
+ $new_smsg->{eidx_key} = $ibx->eidx_key;
+ $idx->index_eml($eml, $new_smsg);
check_batch_limit($req);
}
@@ -578,7 +579,8 @@ sub _reindex_finalize ($$$) {
my $top_smsg = pop @$stable;
$top_smsg == $smsg or die 'BUG: top_smsg != smsg';
my $ibx = _ibx_for($self, $sync, $smsg);
- $idx->index_eml($eml, $smsg, $ibx->eidx_key);
+ $smsg->{eidx_key} = $ibx->eidx_key;
+ $idx->index_eml($eml, $smsg);
for my $x (reverse @$stable) {
$ibx = _ibx_for($self, $sync, $x);
my $hdr = delete $x->{hdr} // die 'BUG: no {hdr}';
diff --git a/lib/PublicInbox/SearchIdxShard.pm b/lib/PublicInbox/SearchIdxShard.pm
index ea261bda..7ee8a121 100644
--- a/lib/PublicInbox/SearchIdxShard.pm
+++ b/lib/PublicInbox/SearchIdxShard.pm
@@ -49,8 +49,7 @@ sub ipc_atfork_child { # called automatically before ipc_worker_loop
}
sub index_eml {
- my ($self, $eml, $smsg, $eidx_key) = @_;
- $smsg->{eidx_key} = $eidx_key if defined $eidx_key;
+ my ($self, $eml, $smsg) = @_;
$self->ipc_do('add_xapian', $eml, $smsg);
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-31 10:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-31 10:15 [PATCH] extindex: avoid branch Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).