diff options
author | Eric Wong <e@80x24.org> | 2020-12-04 22:03:45 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-12-05 21:41:52 +0000 |
commit | 0a80d0c2e723213e3981d2d6ef0de7cee60ee50c (patch) | |
tree | a7a00f99a4e2d51153723da1861c8e2979cc17cb /lib/PublicInbox/NNTP.pm | |
parent | 9356ec0cc5afc95a8fd398ddf898942ef0acdb74 (diff) | |
download | public-inbox-0a80d0c2e723213e3981d2d6ef0de7cee60ee50c.tar.gz |
We can invalidate ibx->{newsgroup} at config load-time to avoid having to check ibx->{newsgroup} validity in To/Cc: matching. This saves us some hash lookups in all cases.
Diffstat (limited to 'lib/PublicInbox/NNTP.pm')
-rw-r--r-- | lib/PublicInbox/NNTP.pm | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index e0916011..6728f9c5 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -422,14 +422,13 @@ sub header_append ($$$) { sub xref_by_tc ($$$) { my ($xref, $pi_cfg, $smsg) = @_; my $by_addr = $pi_cfg->{-by_addr}; - my $groups = $pi_cfg->{-by_newsgroup}; my $mid = $smsg->{mid}; for my $f (qw(to cc)) { my @ibxs = map { $by_addr->{lc($_)} // () } (PublicInbox::Address::emails($smsg->{$f} // '')); for my $ibx (@ibxs) { - $groups->{my $ngname = $ibx->{newsgroup}} or next; + my $ngname = $ibx->{newsgroup} // next; next if defined $xref->{$ngname}; $xref->{$ngname} = eval { $ibx->mm->num_for($mid) }; } |