diff options
author | Eric Wong <e@80x24.org> | 2023-04-25 10:50:49 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-04-25 20:51:31 +0000 |
commit | 8080f099f6a40ce9b79e62f8c424ece42fdffa7a (patch) | |
tree | b247b2998475a52f721e1e27c78d3f06d7640b11 /lib/PublicInbox/ContentHash.pm | |
parent | 10f31b26e010243ab919dbafeb6f95c6e30640e9 (diff) | |
download | public-inbox-8080f099f6a40ce9b79e62f8c424ece42fdffa7a.tar.gz |
It's possible in theory that Perl could be smarter and free memory a tad sooner this way. Regardless, fewer lines of code is easier-to-navigate/read and can save optree size and reduce parsing times.
Diffstat (limited to 'lib/PublicInbox/ContentHash.pm')
-rw-r--r-- | lib/PublicInbox/ContentHash.pm | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/PublicInbox/ContentHash.pm b/lib/PublicInbox/ContentHash.pm index d3ff146a..a4f6196f 100644 --- a/lib/PublicInbox/ContentHash.pm +++ b/lib/PublicInbox/ContentHash.pm @@ -76,8 +76,7 @@ sub content_digest ($;$) { last; } foreach my $h (qw(Subject Date)) { - my @v = $eml->header($h); - foreach my $v (@v) { + for my $v ($eml->header($h)) { utf8::encode($v); $dig->add("$h\0$v\0"); } @@ -86,8 +85,7 @@ sub content_digest ($;$) { # not in the original message. For the purposes of deduplication, # do not take it into account: foreach my $h (qw(To Cc)) { - my @v = $eml->header($h); - digest_addr($dig, $h, $_) foreach @v; + digest_addr($dig, $h, $_) for ($eml->header($h)); } msg_iter($eml, \&content_dig_i, $dig); $dig; |