]> Sergey Matveev's repositories - public-inbox.git/commitdiff
git: packed_bytes: use GLOB_NOSORT
authorEric Wong <e@yhbt.net>
Sat, 11 Jan 2020 22:34:57 +0000 (22:34 +0000)
committerEric Wong <e@yhbt.net>
Mon, 13 Jan 2020 04:36:39 +0000 (04:36 +0000)
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

index 0ace907e304896728f8c013c29972b9e3308a6d1..15f53495166a6ed4dc43f732f6dbefd7a8064da7 100644 (file)
@@ -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