mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-16 09:11:02 +00:00
Using Course.getNumberOfWaypoints() instead of expensive getWaypoints().size(); see also bug 3380
This commit is contained in:
1 parent
5aa8e5d04b
commit
1548b44696
1 file changed
+1
-1
+1
-1
@@ -1146,7 +1146,7 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
|
||||
int indexOfWaypoint = getRace().getCourse().getIndexOfWaypoint(startOfLeg);
|
||||
if (indexOfWaypoint == -1) {
|
||||
throw new IllegalArgumentException("Waypoint " + startOfLeg + " not found in " + getRace().getCourse());
|
||||
} else if (indexOfWaypoint == Util.size(getRace().getCourse().getWaypoints()) - 1) {
|
||||
} else if (indexOfWaypoint == getRace().getCourse().getNumberOfWaypoints() - 1) {
|
||||
throw new IllegalArgumentException("Waypoint " + startOfLeg + " isn't start of any leg in "
|
||||
+ getRace().getCourse());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user