From: Eric Wong Date: Mon, 11 Mar 2024 19:40:12 +0000 (+0000) Subject: codesearch: deduplicate $git->{nick} field X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c29d8743c68b06e980a4d6f04dc5e4682793e04d;p=thirdparty%2Fpublic-inbox.git codesearch: deduplicate $git->{nick} field While PublicInbox::Config is responsible for some instances of setting $git->{nick}, more PublicInbox::Git objects may be created from loading the cindex and we should do our best to reuse that memory, too. Followup-to: 84ed7ec1c887 (dedupe inbox names, coderepo nicks + git dirs, 2024-03-04) --- diff --git a/lib/PublicInbox/CodeSearch.pm b/lib/PublicInbox/CodeSearch.pm index 48033bb54..e5fa4480a 100644 --- a/lib/PublicInbox/CodeSearch.pm +++ b/lib/PublicInbox/CodeSearch.pm @@ -283,7 +283,8 @@ EOM $nick =~ s!$lre!$nick_pfx!s or next; $dir2cr{$p} = $coderepos->{$nick} //= do { my $git = PublicInbox::Git->new($p); - $git->{nick} = $nick; # for git->pub_urls + my %dedupe = ($nick => undef); + ($git->{nick}) = keys %dedupe; # for git->pub_urls $git; }; }