about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwAtomStream.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-08-01 08:12:27 +0000
committerEric Wong <e@yhbt.net>2020-08-02 08:26:20 +0000
commit77eafbd653d2efac546f2c330d8cf5e84bef2712 (patch)
treef33da0a4570d14882262ea4ee60ad7982afe6b8a /lib/PublicInbox/WwwAtomStream.pm
parentfb4bfa102bfa702f13948ac689e54bac9d0084e0 (diff)
downloadpublic-inbox-77eafbd653d2efac546f2c330d8cf5e84bef2712.tar.gz
remove unnecessary ->header_obj calls
We used ->header_obj in the past as an optimization with
Email::MIME.  That optimization is no longer necessary
with PublicInbox::Eml.

This doesn't make any functional difference even if we were to
go back to Email::MIME.  However, it reduces the amount of code
we have and slightly reduces allocations with PublicInbox::Eml.
Diffstat (limited to 'lib/PublicInbox/WwwAtomStream.pm')
-rw-r--r--lib/PublicInbox/WwwAtomStream.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/PublicInbox/WwwAtomStream.pm b/lib/PublicInbox/WwwAtomStream.pm
index 1ed806fd..388def12 100644
--- a/lib/PublicInbox/WwwAtomStream.pm
+++ b/lib/PublicInbox/WwwAtomStream.pm
@@ -116,9 +116,8 @@ sub atom_header {
 # returns undef or string
 sub feed_entry {
         my ($ctx, $smsg, $eml) = @_;
-        my $hdr = $eml->header_obj;
         my $mid = $smsg->{mid};
-        my $irt = PublicInbox::View::in_reply_to($hdr);
+        my $irt = PublicInbox::View::in_reply_to($eml);
         my $uuid = to_uuid($mid);
         my $base = $ctx->{feed_base_url};
         if (defined $irt) {
@@ -130,13 +129,13 @@ sub feed_entry {
                 $irt = '';
         }
         my $href = $base . mid_href($mid) . '/';
-        my $updated = feed_updated(msg_timestamp($hdr));
+        my $updated = feed_updated(msg_timestamp($eml));
 
-        my $title = $hdr->header('Subject');
+        my $title = $eml->header('Subject');
         $title = '(no subject)' unless defined $title && $title ne '';
         $title = title_tag($title);
 
-        my $from = $hdr->header('From') // $hdr->header('Sender') //
+        my $from = $eml->header('From') // $eml->header('Sender') //
                 $ctx->{-inbox}->{-primary_address};
         my ($email) = PublicInbox::Address::emails($from);
         my $name = ascii_html(join(', ', PublicInbox::Address::names($from)));