about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-31 13:51:36 +0000
committerEric Wong <e@80x24.org>2021-01-01 05:00:39 +0000
commitee3c840f2f4169ebcf16753a10df5a10a08649de (patch)
treee016230fcefe3faa11aa218602d42ad727774615 /lib
parent0d649fc15eab07976344a6ae32a946b2b1c32f4f (diff)
downloadpublic-inbox-ee3c840f2f4169ebcf16753a10df5a10a08649de.tar.gz
As shown recently in commit a05445fb400108e60ede7d377cf3b26a0392eb24
("config: config_fh_parse: micro-optimize"), the relying on
the return value of `push' and defined-or operators can avoid
modifying a the hash value scalar with an increment.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/MID.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/MID.pm b/lib/PublicInbox/MID.pm
index 5aeffb8c..601f4c9b 100644
--- a/lib/PublicInbox/MID.pm
+++ b/lib/PublicInbox/MID.pm
@@ -119,7 +119,7 @@ sub uniq_mids ($;$) {
                         warn "Message-ID: <$mid> too long, truncating\n";
                         $mid = substr($mid, 0, MAX_MID_SIZE);
                 }
-                push(@ret, $mid) unless $seen->{$mid}++;
+                $seen->{$mid} //= push(@ret, $mid);
         }
         \@ret;
 }