Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
perf/aggregate: add display_dir()
author
Christian Couder
<christian.couder@gmail.com>
Mon, 26 Mar 2018 07:24:30 +0000
(09:24 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 28 Mar 2018 00:04:06 +0000
(17:04 -0700)
This new helper function will be reused in a subsequent
commit.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/perf/aggregate.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
90bbd50
)
diff --git
a/t/perf/aggregate.perl
b/t/perf/aggregate.perl
index 821cf1498b78bbb5b43b2bda32bbcc88d580c31b..890d85fa7bc00ed86f7c8c9b7215d8b9a836d185 100755
(executable)
--- a/
t/perf/aggregate.perl
+++ b/
t/perf/aggregate.perl
@@
-147,6
+147,11
@@
sub have_slash {
return 0;
}
return 0;
}
+sub display_dir {
+ my ($d) = @_;
+ return exists $dirabbrevs{$d} ? $dirabbrevs{$d} : $dirnames{$d};
+}
+
sub print_default_results {
my %descrs;
my $descrlen = 4; # "Test"
sub print_default_results {
my %descrs;
my $descrlen = 4; # "Test"
@@
-168,8
+173,7
@@
sub print_default_results {
my %times;
my @colwidth = ((0)x@dirs);
for my $i (0..$#dirs) {
my %times;
my @colwidth = ((0)x@dirs);
for my $i (0..$#dirs) {
- my $d = $dirs[$i];
- my $w = length (exists $dirabbrevs{$d} ? $dirabbrevs{$d} : $dirnames{$d});
+ my $w = length display_dir($dirs[$i]);
$colwidth[$i] = $w if $w > $colwidth[$i];
}
for my $t (@subtests) {
$colwidth[$i] = $w if $w > $colwidth[$i];
}
for my $t (@subtests) {
@@
-188,8
+192,7
@@
sub print_default_results {
printf "%-${descrlen}s", "Test";
for my $i (0..$#dirs) {
printf "%-${descrlen}s", "Test";
for my $i (0..$#dirs) {
- my $d = $dirs[$i];
- printf " %-$colwidth[$i]s", (exists $dirabbrevs{$d} ? $dirabbrevs{$d} : $dirnames{$d});
+ printf " %-$colwidth[$i]s", display_dir($dirs[$i]);
}
print "\n";
print "-"x$totalwidth, "\n";
}
print "\n";
print "-"x$totalwidth, "\n";