TT#69200 Use reverse in reversearray() instead of an ad-hoc implementation

Change-Id: I805e1e7e06b57774275353d1457ed37e5c78a13e
(cherry picked from commit fdc64d61eb)
mr7.5.6
Guillem Jover 6 years ago committed by Rene Krenn
parent b69a7eecd9
commit 30fc05c0c2

@ -104,17 +104,14 @@ sub grouparray {
}
sub reversearray {
my ($array_ptr) = @_;
my ($array_ptr) = @_;
my @result = ();
if (defined $array_ptr and ref $array_ptr eq 'ARRAY') {
my $ubound = (scalar @$array_ptr) - 1;
for (my $i = $ubound; $i >= 0; $i -= 1) {
$result[$i] = $array_ptr->[$ubound - $i];
my @result;
if (defined $array_ptr and ref $array_ptr eq 'ARRAY') {
@result = reverse @{$array_ptr};
}
}
return \@result;
return \@result;
}
sub contains {

Loading…
Cancel
Save