X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FContentId.pm;h=8d77934f20a51665f974da408d7195f26509ec15;hb=95bdac7f09c69036efed537a4d03d5bdd2ae4eb6;hp=eb937a0e722982937f4a93619c00330f7b4d15b2;hpb=65e3cc8f6cc73e45db827cbeee4ccecbf1502496;p=public-inbox.git diff --git a/lib/PublicInbox/ContentId.pm b/lib/PublicInbox/ContentId.pm index eb937a0e..8d77934f 100644 --- a/lib/PublicInbox/ContentId.pm +++ b/lib/PublicInbox/ContentId.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2018-2019 all contributors +# Copyright (C) 2018-2020 all contributors # License: AGPL-3.0+ # Unstable internal API. @@ -60,15 +60,11 @@ 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"); + $dig->add("ref\0$mid\0") unless $seen{$mid}++; } # Only use Sender: if From is not present