Skip to content

Commit

Permalink
Merge pull request #192 from jonkan/fix-trimmed-performance
Browse files Browse the repository at this point in the history
Improve performance of trimmed(from:,to:)
  • Loading branch information
1ec5 committed Jul 19, 2022
2 parents 569e0f0 + a4492d7 commit a58b995
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Turf/Geometries/LineString.swift
Expand Up @@ -134,7 +134,7 @@ extension LineString {
return LineString(slice)
}

traveled += distance(from: coordinates[i], to: coordinates[i + 1]) ?? 0.0
traveled += coordinates[i].distance(to: coordinates[i + 1])
}

if traveled < startDistance { return nil }
Expand Down

0 comments on commit a58b995

Please sign in to comment.