about summary refs log tree commit homepage
path: root/lib/PublicInbox/ContentId.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-01-23 23:05:54 +0000
committerEric Wong <e@yhbt.net>2020-01-24 23:04:50 +0000
commit261f705649bf5bc9c1954b29cfdb3c894cf44be2 (patch)
treeb412d86b2b6c55d73ce693fee428565ba014ed16 /lib/PublicInbox/ContentId.pm
parentae469c583c2ddea48b5923af5986753251bf14ca (diff)
downloadpublic-inbox-261f705649bf5bc9c1954b29cfdb3c894cf44be2.tar.gz
This use of map {} is a common idiom as we no longer consider
the Message-ID as part of the digest.
Diffstat (limited to 'lib/PublicInbox/ContentId.pm')
-rw-r--r--lib/PublicInbox/ContentId.pm9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/PublicInbox/ContentId.pm b/lib/PublicInbox/ContentId.pm
index eb937a0e..0c4a8678 100644
--- a/lib/PublicInbox/ContentId.pm
+++ b/lib/PublicInbox/ContentId.pm
@@ -60,12 +60,9 @@ sub content_digest ($) {
         # References: and In-Reply-To: get used interchangeably
         # in some "duplicates" in LKML.  We treat them the same
         # in SearchIdx, so treat them the same for this:
-        my %seen;
-        foreach my $mid (@{mids($hdr)}) {
-                # do NOT consider the Message-ID as part of the content_id
-                # if we got here, we've already got Message-ID reuse
-                $seen{$mid} = 1;
-        }
+        # do NOT consider the Message-ID as part of the content_id
+        # if we got here, we've already got Message-ID reuse
+        my %seen = map { $_ => 1 } @{mids($hdr)};
         foreach my $mid (@{references($hdr)}) {
                 next if $seen{$mid};
                 $dig->add("ref\0$mid\0");