diff options
author | Eric Wong <e@80x24.org> | 2020-12-20 06:30:12 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-12-20 20:39:11 +0000 |
commit | ab243aa2328e2fc4cf895c99c68345e57cc4653c (patch) | |
tree | 4fc0a13b41befb347deacda2968a10d4c3a84665 /lib/PublicInbox/Config.pm | |
parent | 9fcce78e40b0a7c61797be2aff6c5afeb474568e (diff) | |
download | public-inbox-ab243aa2328e2fc4cf895c99c68345e57cc4653c.tar.gz |
->each_inbox will never attempt to iterate an object without {inboxdir}, and simplify + short-circuit the corresponding code
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 cafd9c3b..199ce019 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -391,9 +391,9 @@ EOF } } - # backwards compatibility: - $ibx->{inboxdir} //= $self->{"$pfx.mainrepo"}; - if (($ibx->{inboxdir} // '') =~ /\n/s) { + # "mainrepo" is backwards compatibility: + $ibx->{inboxdir} //= $self->{"$pfx.mainrepo"} // return; + if ($ibx->{inboxdir} =~ /\n/s) { warn "E: `$ibx->{inboxdir}' must not contain `\\n'\n"; return; } @@ -415,7 +415,6 @@ EOF } } - return unless defined($ibx->{inboxdir}); my $name = $pfx; $name =~ s/\Apublicinbox\.//; |