diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2020-01-29 19:54:32 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2020-01-29 19:54:32 +0100 |
commit | dadb0f6637d92a661fda26f33121750d736d5e6d (patch) | |
tree | f5c591515b7b8de9589ee79f5dca5826a23e3b11 /lib/Travelynx/Controller/Traveling.pm | |
parent | 993f6be6c9524031d878f2c83dcba1fdde11d060 (diff) |
map: improve polyline duplicate detection
Diffstat (limited to 'lib/Travelynx/Controller/Traveling.pm')
-rwxr-xr-x | lib/Travelynx/Controller/Traveling.pm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index 29af8f2..4d3c7d5 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -488,8 +488,7 @@ sub map_history { next; } - my $key - = $from_eva . '!' . $to_eva . '!' . $from_index . '!' . $to_index; + my $key = $from_eva . '!' . $to_eva . '!' . ( $to_index - $from_index ); if ( $seen{$key} ) { next; @@ -498,7 +497,7 @@ sub map_history { $seen{$key} = 1; # direction does not matter at the moment - $key = $to_eva . '!' . $from_eva . '!' . $to_index . '!' . $from_index; + $key = $to_eva . '!' . $from_eva . '!' . ( $to_index - $from_index ); $seen{$key} = 1; @polyline = @polyline[ $from_index .. $to_index ]; |