From 678daa81722dbb14efdb27c51756379426161a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bromo=CC=88?= Date: Tue, 7 Jun 2022 06:30:10 +0200 Subject: [PATCH] Improve performance of trimmed(from:,to:) --- Sources/GeoJSONKitTurf/Turf+LineString.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/GeoJSONKitTurf/Turf+LineString.swift b/Sources/GeoJSONKitTurf/Turf+LineString.swift index 4b73197..3a7ad7b 100644 --- a/Sources/GeoJSONKitTurf/Turf+LineString.swift +++ b/Sources/GeoJSONKitTurf/Turf+LineString.swift @@ -74,7 +74,7 @@ extension GeoJSON.LineString { return GeoJSON.LineString(positions: slice) } - traveled += distance(from: positions[i], to: positions[i + 1]) ?? 0.0 + traveled += positions[i].distance(to: positions[i + 1]) } if traveled < startDistance { return nil }