user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 4/6] admin: do not lazy-load Inbox or Config packages
  2020-01-05 23:23  4% [PATCH 0/6] various cleanups around use/require Eric Wong
@ 2020-01-05 23:23  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-01-05 23:23 UTC (permalink / raw)
  To: meta

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  | 4 ++--
 lib/PublicInbox/Config.pm | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/Admin.pm b/lib/PublicInbox/Admin.pm
index 44b44b6e..1f1b133d 100644
--- a/lib/PublicInbox/Admin.pm
+++ b/lib/PublicInbox/Admin.pm
@@ -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 };
diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm
index ffc31f83..cc8c1eaf 100644
--- a/lib/PublicInbox/Config.pm
+++ b/lib/PublicInbox/Config.pm
@@ -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] ] }

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/6] various cleanups around use/require
@ 2020-01-05 23:23  4% Eric Wong
  2020-01-05 23:23  7% ` [PATCH 4/6] admin: do not lazy-load Inbox or Config packages Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-01-05 23:23 UTC (permalink / raw)
  To: meta

We've accumulated some cruft over the years.  Lets get rid of
some of it and find places where we can help Perl figure more
stuff out at compile-time rather than run-time.

Eric Wong (6):
  hval: export prurl and add prototype
  view: update POSIX::strftime usage
  altid: use msgmap at compile time
  admin: do not lazy-load Inbox or Config packages
  treewide: "require" + "use" cleanup and docs
  syscall: modernize away from pre-Perl-5.6 conventions

 Makefile.PL                        |  2 +-
 lib/PublicInbox/Admin.pm           |  4 ++--
 lib/PublicInbox/AltId.pm           |  3 +--
 lib/PublicInbox/Config.pm          |  2 +-
 lib/PublicInbox/DS.pm              |  5 ++---
 lib/PublicInbox/Daemon.pm          |  2 +-
 lib/PublicInbox/Emergency.pm       |  2 +-
 lib/PublicInbox/ExtMsg.pm          |  5 ++---
 lib/PublicInbox/Filter/RubyLang.pm |  1 -
 lib/PublicInbox/Git.pm             |  2 +-
 lib/PublicInbox/GitHTTPBackend.pm  |  2 +-
 lib/PublicInbox/HTTP.pm            |  3 ++-
 lib/PublicInbox/HTTPD.pm           |  4 ++--
 lib/PublicInbox/Hval.pm            |  5 +++--
 lib/PublicInbox/Import.pm          |  2 +-
 lib/PublicInbox/Listener.pm        |  2 +-
 lib/PublicInbox/MboxGz.pm          |  1 -
 lib/PublicInbox/NNTPD.pm           |  2 +-
 lib/PublicInbox/NewsWWW.pm         |  3 ++-
 lib/PublicInbox/Search.pm          |  2 --
 lib/PublicInbox/SearchIdx.pm       |  2 +-
 lib/PublicInbox/SearchView.pm      |  6 +----
 lib/PublicInbox/SolverGit.pm       |  2 +-
 lib/PublicInbox/Spawn.pm           |  1 -
 lib/PublicInbox/Syscall.pm         | 35 ++++++++++++++----------------
 lib/PublicInbox/TLS.pm             |  2 --
 lib/PublicInbox/Tmpfile.pm         |  2 +-
 lib/PublicInbox/V2Writable.pm      |  2 +-
 lib/PublicInbox/View.pm            | 17 +++++++--------
 lib/PublicInbox/ViewDiff.pm        |  2 +-
 lib/PublicInbox/WatchMaildir.pm    |  2 +-
 lib/PublicInbox/WwwAtomStream.pm   |  2 +-
 lib/PublicInbox/WwwListing.pm      |  6 ++---
 lib/PublicInbox/WwwStream.pm       |  4 ++--
 lib/PublicInbox/Xapcmd.pm          |  2 +-
 script/public-inbox-convert        |  2 --
 script/public-inbox-edit           |  8 +++----
 script/public-inbox-init           |  4 ++--
 script/public-inbox-nntpd          |  4 ++--
 t/cgi.t                            |  2 --
 t/feed.t                           |  2 --
 41 files changed, 71 insertions(+), 92 deletions(-)

^ permalink raw reply	[relevance 4%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-01-05 23:23  4% [PATCH 0/6] various cleanups around use/require Eric Wong
2020-01-05 23:23  7% ` [PATCH 4/6] admin: do not lazy-load Inbox or Config packages Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).