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.
if (my $git = $dir2cr{$_}) {
$ibx_p2g{$_} = $git;
$ibx2self = 1;
- $ibx->{-hide}->{www} or
+ $ibx->{-hide_www} or
push @{$git->{ibx_score}},
[ $nr, $ibx->{name} ];
push @$gits, $git;
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;
}
sub hide_inbox {
my ($ctx, $ibx, $re) = @_;
- $ibx->{-hide}->{$ctx->hide_key} ||
+ $ibx->{'-hide_'.$ctx->hide_key} ||
!grep(/$re/, @{$ibx->{url} // $ctx->{-name_is_url} // []})
}