From 87d944b6039667735884e37baff4f9fa94aca5db Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 19 May 2024 21:55:01 +0000 Subject: [PATCH] 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. --- lib/PublicInbox/Config.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 <