From 77eafbd653d2efac546f2c330d8cf5e84bef2712 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 1 Aug 2020 08:12:27 +0000 Subject: 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. --- lib/PublicInbox/WwwAtomStream.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/PublicInbox/WwwAtomStream.pm') 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))); -- cgit v1.2.3-24-ge0c7