TT#69200 Pass the entire list to push in mergearrays()

We do not need to add one item at a time, push accepts a list as an
argument.

Change-Id: I30d81f941c1ce91cb2ed90662cbd9e9daf6fa09f
(cherry picked from commit 0991288e50)
changes/16/36316/1
Guillem Jover 6 years ago committed by Rene Krenn
parent cf8c5bdc6a
commit 43e5dff9d8

@ -24,21 +24,17 @@ our @EXPORT_OK = qw(
array_to_map);
sub mergearrays {
my ($array_ptr1, $array_ptr2) = @_;
my ($array_ptr1,$array_ptr2) = @_;
my @result = ();
if (defined $array_ptr1 and ref $array_ptr1 eq 'ARRAY') {
foreach my $element (@$array_ptr1) {
push @result,$element;
my @result;
if (defined $array_ptr1 and ref $array_ptr1 eq 'ARRAY') {
push @result, @{$array_ptr1};
}
}
if (defined $array_ptr2 and ref $array_ptr2 eq 'ARRAY') {
foreach my $element (@$array_ptr2) {
push @result,$element;
if (defined $array_ptr2 and ref $array_ptr2 eq 'ARRAY') {
push @result, @{$array_ptr2};
}
}
return \@result;
return \@result;
}
sub removeduplicates {

Loading…
Cancel
Save