Using Course.getNumberOfWaypoints() instead of expensive getWaypoints().size(); see also bug 3380

This commit is contained in:
Axel Uhl committed 2015-12-03 15:37:18 +01:00
1 parent 5aa8e5d04b
commit 1548b44696
1 file changed
+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());
}