about summary refs log tree commit homepage
path: root/lib/PublicInbox/Config.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-20 06:30:12 +0000
committerEric Wong <e@80x24.org>2020-12-20 20:39:11 +0000
commitab243aa2328e2fc4cf895c99c68345e57cc4653c (patch)
tree4fc0a13b41befb347deacda2968a10d4c3a84665 /lib/PublicInbox/Config.pm
parent9fcce78e40b0a7c61797be2aff6c5afeb474568e (diff)
downloadpublic-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.pm7
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\.//;