Skip to content

Commit

Permalink
Improve performance of trimmed(from:,to:)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkan authored and nighthawk committed Aug 25, 2022
1 parent b0c9249 commit 678daa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/GeoJSONKitTurf/Turf+LineString.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 678daa8

Please sign in to comment.