about summary refs log tree commit homepage
path: root/lib/PublicInbox/Config.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-11-01 19:06:09 +0000
committerEric Wong <e@80x24.org>2021-11-01 19:49:39 +0000
commit8d2513221e73649aed85ce8c3f37f7025ec1fec9 (patch)
treef133a22e4174ae5326a45ca2a3dc63604f0c72d4 /lib/PublicInbox/Config.pm
parentb46de4da83d797281af9603f350e5b7105845eed (diff)
downloadpublic-inbox-8d2513221e73649aed85ce8c3f37f7025ec1fec9.tar.gz
treewide: kill problematic "$h->{k} //= do {" assignments
As stated in the previous change, conditional hash assignments
which trigger other hash assignments seem problematic, at times.
So replace:

	$h->{k} //= do { $h->{x} = ...; $val };

	$h->{k} // do {
		$h->{x} = ...;
		$hk->{k} = $val
	};

"||=" is affected the same way, and some instances of "||=" are
replaced with "//=" or "// do {", now.
Diffstat (limited to 'lib/PublicInbox/Config.pm')
-rw-r--r--lib/PublicInbox/Config.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm
index 41117ac5..0f002e5e 100644
--- a/lib/PublicInbox/Config.pm
+++ b/lib/PublicInbox/Config.pm
@@ -377,8 +377,8 @@ sub get_1 {
 
 sub repo_objs {
         my ($self, $ibxish) = @_;
-        my $ibx_code_repos = $ibxish->{coderepo} or return;
-        $ibxish->{-repo_objs} //= do {
+        my $ibx_code_repos = $ibxish->{coderepo} // return;
+        $ibxish->{-repo_objs} // do {
                 my $code_repos = $self->{-code_repos};
                 my @repo_objs;
                 for my $nick (@$ibx_code_repos) {
@@ -395,10 +395,9 @@ sub repo_objs {
                         push @repo_objs, $repo if $repo;
                 }
                 if (scalar @repo_objs) {
-                        \@repo_objs;
+                        $ibxish ->{-repo_objs} = \@repo_objs;
                 } else {
                         delete $ibxish->{coderepo};
-                        undef;
                 }
         }
 }