diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-04-29 18:27:32 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-04-29 18:27:32 +0200 |
commit | fc59bcacf2f9855ac1ff7ed9e709d5277eb9651b (patch) | |
tree | 587cd4ff3df10768fcb1d56bfabd021fbe02f870 /lib/Travel/Status/DE/DBWagenreihung.pm | |
parent | ca55ab0cd25c776f7a4fd544884dd661a47ef73c (diff) |
sort wagon groups as well, if possible
Diffstat (limited to 'lib/Travel/Status/DE/DBWagenreihung.pm')
-rw-r--r-- | lib/Travel/Status/DE/DBWagenreihung.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm index c6163cc..f3e38f0 100644 --- a/lib/Travel/Status/DE/DBWagenreihung.pm +++ b/lib/Travel/Status/DE/DBWagenreihung.pm @@ -360,6 +360,10 @@ sub parse_wagons { for my $group (@wagon_groups) { $group->sort_wagons; } + @wagon_groups = sort { + $a->{wagons}[0]{position}{start_percent} + <=> $b->{wagons}[0]{position}{start_percent} + } @wagon_groups; } for my $i ( 0 .. $#wagon_groups ) { |