thousands here too, on long paths

This commit is contained in:
Leijurv 2018-11-25 22:57:54 -08:00
parent 06dd07dbc6
commit cf2765e017
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -109,8 +109,9 @@ public interface IPath {
default double ticksRemainingFrom(int pathPosition) { default double ticksRemainingFrom(int pathPosition) {
double sum = 0; double sum = 0;
//this is fast because we aren't requesting recalculation, it's just cached //this is fast because we aren't requesting recalculation, it's just cached
for (int i = pathPosition; i < movements().size(); i++) { List<IMovement> movements = movements();
sum += movements().get(i).getCost(); for (int i = pathPosition; i < movements.size(); i++) {
sum += movements.get(i).getCost();
} }
return sum; return sum;
} }