From: Eric Wong Date: Sun, 19 May 2024 21:55:01 +0000 (+0000) Subject: config: dedupe ibx->{newsgroup} X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87d944b6039667735884e37baff4f9fa94aca5db;p=thirdparty%2Fpublic-inbox.git config: dedupe ibx->{newsgroup} We definitely use newsgroup names as hash keys, so get rid of the duplicate value for some memory savings when we have hundreds or thousands of newsgroups. --- diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index 49659a2e6..e18439120 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -517,7 +517,9 @@ sub _fill_ibx { delete $ibx->{newsgroup}; warn "newsgroup name invalid: `$ngname'\n"; } else { - my $lc = $ibx->{newsgroup} = lc $ngname; + %dedupe = (lc($ngname) => undef); + my ($lc) = keys %dedupe; + $ibx->{newsgroup} = $lc; warn <