TT#69200 Use List::Util max() and min() instead of ad-hoc code

This is a core module, which requires no additional dependencies.

Change-Id: If7034c4478bcf5f39d0a3f1f9b4f09da475fcc52
changes/85/34385/2
Guillem Jover 6 years ago
parent 565f539825
commit 548fa1a352

@ -9,6 +9,8 @@ use threads;
use POSIX qw(strtod locale_h floor fmod);
setlocale(LC_NUMERIC, 'C');
use List::Util qw(max min);
use Data::UUID qw();
use UUID qw();
@ -708,14 +710,7 @@ sub min_timestamp {
my (@timestamps) = @_;
my $min_ts = $timestamps[0];
foreach my $ts (@timestamps) {
if (($ts cmp $min_ts) < 0) {
$min_ts = $ts;
}
}
return $min_ts;
return min(@timestamps);
}
@ -723,14 +718,7 @@ sub max_timestamp {
my (@timestamps) = @_;
my $min_ts = $timestamps[0];
foreach my $ts (@timestamps) {
if (($ts cmp $min_ts) > 0) {
$min_ts = $ts;
}
}
return $min_ts;
return max(@timestamps);
}

Loading…
Cancel
Save