I somehow thought "foreach (<$cat>)" could work like "while (<$cat>)" when it came to iterating over file handles... --- xt/git_async_cmp.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xt/git_async_cmp.t b/xt/git_async_cmp.t index f8ffe3d9..18fce3db 100644 --- a/xt/git_async_cmp.t +++ b/xt/git_async_cmp.t @@ -27,7 +27,7 @@ my $async = timeit($nr, sub { my $cat = $git->popen(@cat); $git->cat_async_begin; - foreach (<$cat>) { + while (<$cat>) { my ($oid, undef, undef) = split(/ /); $git->cat_async($oid, $cb); } @@ -39,7 +39,7 @@ my $async = timeit($nr, sub { my $sync = timeit($nr, sub { my $dig = Digest::SHA->new(1); my $cat = $git->popen(@cat); - foreach (<$cat>) { + while (<$cat>) { my ($oid, undef, undef) = split(/ /); my $bref = $git->cat_file($oid); $dig->add($$bref);
One bugfix for solver, a couple of optimizations which will make sense when dealing with many and larger code repos. And some cleanups to reduce redundant code. Eric Wong (9): config: do not slurp entire cgitrc at once git: modified: don't slurp `rev-parse --branches' git: packed_bytes: use GLOB_NOSORT solver: path_a may be undef from /dev/null cgit: drop cgit_parse_hdr wrapper xapcmd: use popen_rd for running xapian-compact xt/git_async_cmp: do not slurp large OID list into memory t/solver_git: avoid uninitialized warnings in hostname generation use popen_rd for bidirectional pipes lib/PublicInbox/Cgit.pm | 9 ++------- lib/PublicInbox/Config.pm | 4 ++-- lib/PublicInbox/Git.pm | 24 +++++++++++------------- lib/PublicInbox/Import.pm | 8 +++----- lib/PublicInbox/SolverGit.pm | 4 ++-- lib/PublicInbox/V2Writable.pm | 11 +++-------- lib/PublicInbox/Xapcmd.pm | 16 +++++----------- t/solver_git.t | 12 ++++++------ xt/git_async_cmp.t | 4 ++-- 9 files changed, 36 insertions(+), 56 deletions(-) DELETE! DELETE! DELETE!