From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5DA9E1FD54 for ; Sat, 11 Jan 2020 22:35:04 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/9] git: packed_bytes: use GLOB_NOSORT Date: Sat, 11 Jan 2020 22:34:57 +0000 Message-Id: <20200111223503.24473-4-e@yhbt.net> In-Reply-To: <20200111223503.24473-1-e@yhbt.net> References: <20200111223503.24473-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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(-) 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