about summary refs log tree commit homepage
path: root/lib/PublicInbox/Config.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-27 02:53:07 -0500
committerEric Wong <e@80x24.org>2021-09-27 09:22:49 +0000
commit996de3c67d490b4052bd16179b229b30c2f890f8 (patch)
treed9f58dbdd5b5889640ddc7d2a6b7cf39acff8c90 /lib/PublicInbox/Config.pm
parent751df49e7db8ba770dff28fb701b31c57ca200e2 (diff)
downloadpublic-inbox-996de3c67d490b4052bd16179b229b30c2f890f8.tar.gz
Instead of passing the prefix section and key separately, pass
them together as is commonly done with git-config(1) usage as
well as our ->get_all API.  This inconsistency in the get_1 API
is a needless footgun and confused me a bit while working on
"lei up" the other week.
Diffstat (limited to 'lib/PublicInbox/Config.pm')
-rw-r--r--lib/PublicInbox/Config.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm
index b3bf5d12..d38f6586 100644
--- a/lib/PublicInbox/Config.pm
+++ b/lib/PublicInbox/Config.pm
@@ -385,10 +385,10 @@ sub rel2abs_collapsed {
 }
 
 sub get_1 {
-        my ($self, $pfx, $k) = @_;
-        my $v = $self->{"$pfx.$k"} // return;
+        my ($self, $key) = @_;
+        my $v = $self->{$key};
         return $v if !ref($v);
-        warn "W: $pfx.$k has multiple values, only using `$v->[-1]'\n";
+        warn "W: $key has multiple values, only using `$v->[-1]'\n";
         $v->[-1];
 }
 
@@ -430,7 +430,7 @@ sub _fill_ibx {
         }
         for my $k (qw(filter inboxdir newsgroup replyto httpbackendmax feedmax
                         indexlevel indexsequentialshard boost)) {
-                my $v = get_1($self, $pfx, $k) // next;
+                my $v = get_1($self, "$pfx.$k") // next;
                 $ibx->{$k} = $v;
         }
 
@@ -523,7 +523,7 @@ sub _fill_ei ($$) {
         }
         my $es = PublicInbox::ExtSearch->new($d);
         for my $k (qw(indexlevel indexsequentialshard)) {
-                my $v = get_1($self, $pfx, $k) // next;
+                my $v = get_1($self, "$pfx.$k") // next;
                 $es->{$k} = $v;
         }
         for my $k (qw(coderepo hide url infourl)) {