diff options
author | Eric Wong <e@80x24.org> | 2021-11-01 19:06:09 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-11-01 19:49:39 +0000 |
commit | 8d2513221e73649aed85ce8c3f37f7025ec1fec9 (patch) | |
tree | f133a22e4174ae5326a45ca2a3dc63604f0c72d4 /lib/PublicInbox/Config.pm | |
parent | b46de4da83d797281af9603f350e5b7105845eed (diff) | |
download | public-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.pm | 7 |
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; } } } |