MT#60917 NGCP::Template::Object: Do not use sort on return

The sort function is undefined in scalar context, which means a call
site that calls these functions in scalar context will trigger undefined
behavior.

Sort the result and return the list.

Fixes: Subroutines::ProhibitReturnSort
Warned-by: perlcritic
Change-Id: I355b5e3e412bc91c297a46a73bb6caba6e969f54
mr13.0
Guillem Jover 7 months ago
parent fda5db9456
commit d59b6c7cd8

@ -182,7 +182,8 @@ sub get_sibnames
push @sibnames, $thishost;
}
return sort @sibnames;
my @res = sort @sibnames;
return @res;
}
sub get_firstname
@ -259,7 +260,8 @@ sub get_hosts
push @hosts, $host;
}
return sort @hosts;
my @res = sort @hosts;
return @res;
}
sub get_instances

Loading…
Cancel
Save