]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/ContentHash.pm
www: make coderepo URL generation more consistent
[public-inbox.git] / lib / PublicInbox / ContentHash.pm
index bacc9cdda12498abbb0ada5d2a2e2faec10190f2..1afbb413a697b99e6ae23b6ef20c1d488526613e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2018-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
 # Unstable internal API.
@@ -63,8 +63,9 @@ sub content_digest ($;$) {
        # do NOT consider the Message-ID as part of the content_hash
        # if we got here, we've already got Message-ID reuse
        my %seen = map { $_ => 1 } @{mids($eml)};
-       foreach my $mid (@{references($eml)}) {
-               $dig->add("ref\0$mid\0") unless $seen{$mid}++;
+       for (grep { !$seen{$_}++ } @{references($eml)}) {
+               utf8::encode($_);
+               $dig->add("ref\0$_\0");
        }
 
        # Only use Sender: if From is not present