diff options
author | Eric Wong <e@80x24.org> | 2023-11-30 11:41:07 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-11-30 21:37:00 +0000 |
commit | 2e3d2fdcad7181b8b4a8893023d4819a25e54ba1 (patch) | |
tree | 114b05e53720efe6205d303fbd7d6c8d3e63b79d /lib/PublicInbox/Inbox.pm | |
parent | fa9d151442450469f401f6e0b325c680e9a4cde2 (diff) | |
download | public-inbox-2e3d2fdcad7181b8b4a8893023d4819a25e54ba1.tar.gz |
We no longer vivify the intermediate $ibx->{-hide} hashref, instead we use $ibx->{-hide_$KEY} directly. This avoids an intermediate hashref and extra hash table lookups.
Diffstat (limited to 'lib/PublicInbox/Inbox.pm')
-rw-r--r-- | lib/PublicInbox/Inbox.pm | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 7af0ad90..dd689221 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -70,12 +70,8 @@ sub new { delete $opts->{feedmax}; } # allow any combination of multi-line or comma-delimited hide entries - my $hide = {}; - if (defined(my $h = $opts->{hide})) { - foreach my $v (@$h) { - $hide->{$_} = 1 foreach (split(/\s*,\s*/, $v)); - } - $opts->{-hide} = $hide; + for $v (@{delete($opts->{hide}) // []}) { + $opts->{-'hide_'.$_} = 1 for split(/\s*,\s*/, $v); } bless $opts, $class; } |