about summary refs log tree commit homepage
path: root/lib/PublicInbox/ContentHash.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-29 23:41:09 -0600
committerEric Wong <e@80x24.org>2021-01-31 02:11:06 +0000
commit39a85f0d21e7effa94109ca2dac292e110345a15 (patch)
tree407782bd957e9751b7e6c57633572552e0baf263 /lib/PublicInbox/ContentHash.pm
parent12a067a41430f579f5a3cea4e2d027242e604f72 (diff)
downloadpublic-inbox-39a85f0d21e7effa94109ca2dac292e110345a15.tar.gz
This regression was introduced long ago and matches behavior
originally specified in the comments.  It makes a noticeable
improvement with search results using -extindex ("all") and
lei results with multiple inboxes.

Update some style bits at the top of the test case while
we're at it.

Fixes: f0ef0a56a8957d6f ("v2: improve deduplication checks")
Diffstat (limited to 'lib/PublicInbox/ContentHash.pm')
-rw-r--r--lib/PublicInbox/ContentHash.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/PublicInbox/ContentHash.pm b/lib/PublicInbox/ContentHash.pm
index 838fdd6f..4dbe7b50 100644
--- a/lib/PublicInbox/ContentHash.pm
+++ b/lib/PublicInbox/ContentHash.pm
@@ -68,10 +68,9 @@ sub content_digest ($) {
 
         # Only use Sender: if From is not present
         foreach my $h (qw(From Sender)) {
-                my @v = $eml->header($h);
-                if (@v) {
-                        digest_addr($dig, $h, $_) foreach @v;
-                }
+                my @v = $eml->header($h) or next;
+                digest_addr($dig, $h, $_) foreach @v;
+                last;
         }
         foreach my $h (qw(Subject Date)) {
                 my @v = $eml->header($h);