]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: use header_obj to avoid extra method calls
authorEric Wong <e@80x24.org>
Sun, 13 Sep 2015 23:28:53 +0000 (23:28 +0000)
committerEric Wong <e@80x24.org>
Sun, 13 Sep 2015 23:28:53 +0000 (23:28 +0000)
Email::MIME will call the header_obj each time anyways, avoid
the extra method lookups and hit header_obj directly for the
header lookup.

lib/PublicInbox/View.pm

index 6cb340b0df9206c2490c265df2313caded4c0ec1..2cda691c99d42fb7ffefd51e76baa9ea1aeb6d80 100644 (file)
@@ -410,7 +410,7 @@ sub headers_to_html_header {
        my $mid = $header_obj->header('Message-ID');
        $mid = PublicInbox::Hval->new_msgid($mid);
        foreach my $h (qw(From To Cc Subject Date)) {
-               my $v = $mime->header($h);
+               my $v = $header_obj->header($h);
                defined($v) && ($v ne '') or next;
                $v = PublicInbox::Hval->new_oneline($v);