Browse Source

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
commit
bf514fb2a0
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      perl/NGCP/Rtpclient/ICE.pm

+ 4
- 1
perl/NGCP/Rtpclient/ICE.pm View File

@ -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