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 committed Jun 16, 2022
1 parent 569e0f0 commit a4492d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Turf/Geometries/LineString.swift
Original file line number Diff line number Diff line change
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 a4492d7

Please sign in to comment.