diff options
author | Eric Wong <e@yhbt.net> | 2020-03-20 08:18:18 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-03-22 09:00:23 +0000 |
commit | 1218a4126807951a0f47286338dc04d7f197bb78 (patch) | |
tree | 5f97519d19a5fdfb92feecd8e64db43c036432d5 /lib/PublicInbox/SearchIdxShard.pm | |
parent | d34a4b80724e3f77a507ad08b91039427b0e09d5 (diff) | |
download | public-inbox-1218a4126807951a0f47286338dc04d7f197bb78.tar.gz |
We can pass blessed PublicInbox::Smsg objects to internal indexing APIs instead of having long parameter lists in some places. The end goal is to avoid parsing redundant information each step of the way and hopefully make things more understandable.
Diffstat (limited to 'lib/PublicInbox/SearchIdxShard.pm')
-rw-r--r-- | lib/PublicInbox/SearchIdxShard.pm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/PublicInbox/SearchIdxShard.pm b/lib/PublicInbox/SearchIdxShard.pm index 74c624a4..d29e6090 100644 --- a/lib/PublicInbox/SearchIdxShard.pm +++ b/lib/PublicInbox/SearchIdxShard.pm @@ -76,7 +76,13 @@ sub shard_worker_loop ($$$$$) { $artnum = int($artnum); $self->{autime} = $autime; $self->{cotime} = $cotime; - $self->add_message($mime, $n, $artnum, $oid, $mid0); + my $smsg = bless { + bytes => $len, + num => $artnum, + blob => $oid, + mid => $mid0, + }, 'PublicInbox::Smsg'; + $self->add_message($mime, $smsg); } } $self->worker_done; @@ -95,7 +101,13 @@ sub index_raw { $self->begin_txn_lazy; $self->{autime} = $at; $self->{cotime} = $ct; - $self->add_message($mime, $bytes, $artnum, $oid, $mid0); + my $smsg = bless { + bytes => $bytes, + num => $artnum, + blob => $oid, + mid => $mid0, + }, 'PublicInbox::Smsg'; + $self->add_message($mime, $smsg); } } |