From dadb0f6637d92a661fda26f33121750d736d5e6d Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 29 Jan 2020 19:54:32 +0100 Subject: map: improve polyline duplicate detection --- lib/Travelynx/Controller/Traveling.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/Travelynx/Controller') 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 ]; -- cgit v1.2.3