about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-01-23 23:05:57 +0000
committerEric Wong <e@yhbt.net>2020-01-24 23:04:55 +0000
commit7d4858ea519cfe71cddc425ef4d39d6eea250b23 (patch)
tree08ab921e704cc65ee63c8f8df86e02326341ea86 /lib
parentff2db829115a5db9cc4d046b4a9018cfba4ca6c0 (diff)
downloadpublic-inbox-7d4858ea519cfe71cddc425ef4d39d6eea250b23.tar.gz
We won't be able to use List::Util::uniq here, but we can still
shorten our logic and make it more consistent with the rest of
our code which does similar things.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/MID.pm4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/PublicInbox/MID.pm b/lib/PublicInbox/MID.pm
index d7a42c38..33d5af74 100644
--- a/lib/PublicInbox/MID.pm
+++ b/lib/PublicInbox/MID.pm
@@ -120,9 +120,7 @@ sub uniq_mids ($;$) {
                         warn "Message-ID: <$mid> too long, truncating\n";
                         $mid = substr($mid, 0, MAX_MID_SIZE);
                 }
-                next if $seen->{$mid};
-                push @ret, $mid;
-                $seen->{$mid} = 1;
+                push(@ret, $mid) unless $seen->{$mid}++;
         }
         \@ret;
 }