about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-23 20:05:41 +0000
committerEric Wong <e@80x24.org>2015-08-23 22:35:21 +0000
commita4f7622064f71c02102cb17fce0b4e67782059fc (patch)
treed980783cbe2fcb09f9e9ea891b7eb131960b1030 /lib/PublicInbox/SearchIdx.pm
parent2b1e7946abd1d589fc69b758c68497458bbf0ecf (diff)
downloadpublic-inbox-a4f7622064f71c02102cb17fce0b4e67782059fc.tar.gz
Dereference header_obj only once when performance may be
critical, or simplify our code by calling "header" directly on
the Email::{Simple,MIME} object if not.
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 2c2f8193..05bf3465 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -41,7 +41,7 @@ sub add_message {
         my $db = $self->{xdb};
 
         my $doc_id;
-        my $mid_orig = mid_clean($mime->header_obj->header('Message-ID'));
+        my $mid_orig = mid_clean($mime->header('Message-ID'));
         my $mid = mid_compressed($mid_orig);
         my $was_ghost = 0;
         my $ct_msg = $mime->header('Content-Type') || 'text/plain';
@@ -208,9 +208,9 @@ sub link_message_to_parents {
         my $doc = $smsg->{doc};
         my $mid = mid_compressed($smsg->mid);
         my $mime = $smsg->mime;
-        my $refs = $mime->header_obj->header('References');
+        my $refs = $mime->header('References');
         my @refs = $refs ? ($refs =~ /<([^>]+)>/g) : ();
-        my $irt = $mime->header_obj->header('In-Reply-To');
+        my $irt = $mime->header('In-Reply-To');
         if ($irt) {
                 $irt = mid_compressed(mid_clean($irt));
 
@@ -273,7 +273,7 @@ sub index_blob {
 sub unindex_blob {
         my ($self, $git, $blob) = @_;
         my $mime = do_cat_mail($git, $blob) or return;
-        my $mid = $mime->header_obj->header('Message-ID');
+        my $mid = $mime->header('Message-ID');
         eval { $self->remove_message($mid) } if defined $mid;
         warn "W: unindex_blob $blob: $@\n" if $@;
 }