From: Eric Wong <e@yhbt.net>
Date: Sat, 11 Jan 2020 22:34:57 +0000 (+0000)
Subject: git: packed_bytes: use GLOB_NOSORT
X-Git-Tag: v1.3.0~109
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ed3e1ad3bb9c07835dee97c76b4454b98faf0dcd;p=public-inbox.git

git: packed_bytes: use GLOB_NOSORT

File::Glob is loaded by the perl for the "glob()" op, anyways,
so call bsd_glob with the GLOB_NOSORT to avoid needless sorting
of the output.
---

diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index 0ace907e..15f53495 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -11,6 +11,7 @@ use strict;
 use warnings;
 use POSIX qw(dup2);
 use IO::Handle; # ->autoflush
+use File::Glob qw(bsd_glob GLOB_NOSORT);
 use PublicInbox::Spawn qw(spawn popen_rd);
 use PublicInbox::Tmpfile;
 use base qw(Exporter);
@@ -276,7 +277,7 @@ sub packed_bytes {
 	my ($self) = @_;
 	my $n = 0;
 	my $pack_dir = git_path($self, 'objects/pack');
-	foreach my $p (glob("$pack_dir/*.pack")) {
+	foreach my $p (bsd_glob("$pack_dir/*.pack", GLOB_NOSORT)) {
 		$n += -s $p;
 	}
 	$n