From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: 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.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 873351FAEB for ; Wed, 28 Feb 2018 23:42:08 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Subject: [PATCH 09/21] searchidx: get rid of pointless index_blob wrapper Date: Wed, 28 Feb 2018 23:41:50 +0000 Message-Id: <20180228234202.8839-10-e@80x24.org> In-Reply-To: <20180228234202.8839-1-e@80x24.org> References: <20180228234202.8839-1-e@80x24.org> List-Id: This used to lookup the message in git, but no longer, so remove a needless indirection layer and call add_message directly. --- lib/PublicInbox/SearchIdx.pm | 11 +++-------- lib/PublicInbox/SearchIdxPart.pm | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 0c3445d..00b24d6 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -491,11 +491,6 @@ sub link_message { $smsg->{doc}->add_term('G' . $tid); } -sub index_blob { - my ($self, $mime, $bytes, $num, $blob) = @_; - $self->add_message($mime, $bytes, $num, $blob); -} - sub index_git_blob_id { my ($doc, $pfx, $objid) = @_; @@ -532,7 +527,7 @@ sub unindex_mm { sub index_mm2 { my ($self, $mime, $bytes, $blob) = @_; my $num = $self->{mm}->num_for(mid_clean(mid_mime($mime))); - index_blob($self, $mime, $bytes, $num, $blob); + add_message($self, $mime, $bytes, $num, $blob); } sub unindex_mm2 { @@ -544,7 +539,7 @@ sub unindex_mm2 { sub index_both { my ($self, $mime, $bytes, $blob) = @_; my $num = index_mm($self, $mime); - index_blob($self, $mime, $bytes, $num, $blob); + add_message($self, $mime, $bytes, $num, $blob); } sub unindex_both { @@ -711,7 +706,7 @@ sub _index_sync { } } else { # user didn't install DBD::SQLite and DBI - rlog($self, $xlog, *index_blob, *unindex_blob, $cb); + rlog($self, $xlog, *add_message, *unindex_blob, $cb); } } diff --git a/lib/PublicInbox/SearchIdxPart.pm b/lib/PublicInbox/SearchIdxPart.pm index bffa532..ee79e08 100644 --- a/lib/PublicInbox/SearchIdxPart.pm +++ b/lib/PublicInbox/SearchIdxPart.pm @@ -59,7 +59,7 @@ sub partition_worker_loop ($$$) { my $n = read($r, my $msg, $len) or die "read: $!\n"; $n == $len or die "short read: $n != $len\n"; my $mime = PublicInbox::MIME->new(\$msg); - $self->index_blob($mime, $len, $artnum, $object_id); + $self->add_message($mime, $len, $artnum, $object_id); } } warn "$$ still in transaction\n" if $txn; -- EW