simplify code

This commit is contained in:
Yanick Champoux 2023-08-26 12:50:48 -04:00
parent acc6a64388
commit e0ac19d7c0

View File

@ -80,10 +80,13 @@ sub generate_output_table ($ts) {
} }
# sort hash by the average and print to screen # sort hash by the average and print to screen
return Text::SimpleTable::AutoWidth->new( my $tbl = Text::SimpleTable::AutoWidth->new(
captions => [qw/ Computer GHZDaysPerDay /] ); captions => [qw/ Computer GHZDaysPerDay /] );
foreach foreach
my $key ( reverse sort { $ranks{$a} <=> $ranks{$b} } keys(%ranks) ) { my $key ( reverse sort { $ranks{$a} <=> $ranks{$b} } keys(%ranks) ) {
$tbl->row( $key, $ranks{$key} ); $tbl->row( $key, $ranks{$key} );
} }
return $tbl;
} }