diff options
author | Eric Wong <e@yhbt.net> | 2020-08-01 08:12:27 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-08-02 08:26:20 +0000 |
commit | 77eafbd653d2efac546f2c330d8cf5e84bef2712 (patch) | |
tree | f33da0a4570d14882262ea4ee60ad7982afe6b8a /lib/PublicInbox/WwwAtomStream.pm | |
parent | fb4bfa102bfa702f13948ac689e54bac9d0084e0 (diff) | |
download | public-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.pm | 9 |
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))); |