about summary refs log tree commit homepage
path: root/lib/PublicInbox/Mbox.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/Mbox.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/Mbox.pm')
-rw-r--r--lib/PublicInbox/Mbox.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm
index 9af92793..719398f7 100644
--- a/lib/PublicInbox/Mbox.pm
+++ b/lib/PublicInbox/Mbox.pm
@@ -27,14 +27,15 @@ sub emit1 {
 
 sub emit_msg {
         my ($fh, $simple) = @_; # Email::Simple object
+        my $header_obj = $simple->header_obj;
 
         # drop potentially confusing headers, ssoma already should've dropped
         # Lines and Content-Length
         foreach my $d (qw(Lines Content-Length Status)) {
-                $simple->header_set($d);
+                $header_obj->header_set($d);
         }
 
-        my $buf = $simple->header_obj->as_string;
+        my $buf = $header_obj->as_string;
         unless ($buf =~ /\AFrom /) {
                 $fh->write("From mboxrd\@z Thu Jan  1 00:00:00 1970\n");
         }