From ed3e1ad3bb9c07835dee97c76b4454b98faf0dcd Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 11 Jan 2020 22:34:57 +0000 Subject: 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. --- lib/PublicInbox/Git.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.3-24-ge0c7