diff options
Diffstat (limited to 'report.cgi')
-rwxr-xr-x | report.cgi | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/report.cgi b/report.cgi index 33d46675f..4c9a98b8a 100755 --- a/report.cgi +++ b/report.cgi @@ -349,7 +349,9 @@ sub get_names { # the normal order. # # This is O(n^2) but it shouldn't matter for short lists. - @sorted = map {lsearch(\@unsorted, $_) == -1 ? () : $_} @{$field_list}; + foreach my $item (@$field_list) { + push(@sorted, $item) if grep { $_ eq $item } @unsorted; + } } elsif ($isnumeric) { # It's not a field we are preserving the order of, so sort it |