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. --- script/public-inbox-edit | 8 ++++---- script/public-inbox-mda | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'script') diff --git a/script/public-inbox-edit b/script/public-inbox-edit index 2d3c4af4..240beb3a 100755 --- a/script/public-inbox-edit +++ b/script/public-inbox-edit @@ -93,7 +93,7 @@ Multiple messages with different content found matching } } else { my $eml = eml_from_path($file) or die "open($file) failed: $!"; - my $mids = mids($eml->header_obj); + my $mids = mids($eml); find_mid($found, $_, \@ibxs) for (@$mids); # populates $found my $chash = content_hash($eml); my $to_edit = $found->{$chash}; @@ -214,9 +214,9 @@ W: possible message boundary splitting error # allow changing Received: and maybe other headers which can # contain sensitive info. - my $nhdr = $new_mime->header_obj; - my $ohdr = $old_mime->header_obj; - if (($nhdr->as_string eq $ohdr->as_string) && + my $nhdr = $new_mime->header_obj->as_string; + my $ohdr = $old_mime->header_obj->as_string; + if (($nhdr eq $ohdr) && (content_hash($new_mime) eq content_hash($old_mime))) { warn "No change detected to:\n", show_cmd($ibx, $smsg); diff --git a/script/public-inbox-mda b/script/public-inbox-mda index 42d0e00c..02ca3431 100755 --- a/script/public-inbox-mda +++ b/script/public-inbox-mda @@ -119,7 +119,7 @@ for my $ibx (@$dests) { # destination succeeds $emm->abort; } else { # v1-only - my $mid = $mime->header_obj->header_raw('Message-ID'); + my $mid = $mime->header_raw('Message-ID'); # this message is similar to what ssoma-mda shows: print STDERR "CONFLICT: Message-ID: $mid exists\n"; } -- cgit v1.2.3-24-ge0c7