TT#24097 Do not directly return result from sort

Using sort on a scalar context has undefined behavior. Assign the result
of the sort into an array and return that.

Change-Id: I180ba1dfcafe6e49132a38bd01be715718a4dff1
changes/08/16708/2
Guillem Jover 8 years ago
parent aa2eaee95e
commit bf514fb2a0

@ -795,7 +795,10 @@ sub keepalives {
sub sort_pairs {
my ($pair_list) = @_;
return sort {$a->priority() <=> $b->priority()} @$pair_list;
my @sorted_list = sort {
$a->priority() <=> $b->priority()
} @{$pair_list};
return @sorted_list;
}
sub get_send_component {

Loading…
Cancel
Save