]> Sergey Matveev's repositories - public-inbox.git/commitdiff
admin: do not lazy-load Inbox or Config packages
authorEric Wong <e@yhbt.net>
Sun, 5 Jan 2020 23:23:34 +0000 (23:23 +0000)
committerEric Wong <e@yhbt.net>
Mon, 6 Jan 2020 10:20:55 +0000 (10:20 +0000)
No point in lazy-loading these, since they're always loaded
anyways and would not have portability problems on systems with
minimal dependencies.

lib/PublicInbox/Admin.pm
lib/PublicInbox/Config.pm

index 44b44b6eb185c311b693d30edf5d0ead3c1bfa4b..1f1b133d40b4379f27fcdc8bdc28bc845b5e6c9f 100644 (file)
@@ -9,7 +9,8 @@ use warnings;
 use Cwd 'abs_path';
 use base qw(Exporter);
 our @EXPORT_OK = qw(resolve_repo_dir);
-require PublicInbox::Config;
+use PublicInbox::Config;
+use PublicInbox::Inbox;
 use PublicInbox::Spawn qw(popen_rd);
 
 sub resolve_repo_dir {
@@ -68,7 +69,6 @@ sub unconfigured_ibx ($$) {
 
 sub resolve_inboxes ($;$$) {
        my ($argv, $opt, $cfg) = @_;
-       require PublicInbox::Inbox;
        $opt ||= {};
 
        $cfg //= eval { PublicInbox::Config->new };
index ffc31f833c592457a353a91f81eae71de43570d0..cc8c1eafb804e12f8c2c34d53740b24479ed4f11 100644 (file)
@@ -10,7 +10,7 @@
 package PublicInbox::Config;
 use strict;
 use warnings;
-require PublicInbox::Inbox;
+use PublicInbox::Inbox;
 use PublicInbox::Spawn qw(popen_rd);
 
 sub _array ($) { ref($_[0]) eq 'ARRAY' ? $_[0] : [ $_[0] ] }