]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchidx: get rid of pointless index_blob wrapper
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Sat, 24 Feb 2018 00:40:09 +0000 (00:40 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Wed, 28 Feb 2018 18:53:29 +0000 (18:53 +0000)
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
lib/PublicInbox/SearchIdxPart.pm

index 0c3445d5d06c5504ea59181739897e3a41216f8c..00b24d6857d518de1552e7c671a8863fe5704554 100644 (file)
@@ -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);
        }
 }
 
index bffa53255f447ab40a6c01a94ba8822f70ce55fc..ee79e08e1cda02dd37bebcb26a5736a902694490 100644 (file)
@@ -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;