Source:
<code>public void propagate (Reducer reducer) { targets.makePointToStopDistanceTablesIfNeeded(); long startTimeMillis = System.currentTimeMillis(); int speedMillimetersPerSecond = (int) (request.walkSpeed * 1000); for (int targetIdx = 0; targetIdx < targets.size(); targetIdx++) { boolean[] perIterationResults = new boolean[travelTimesToStopsEachIteration.length]; Arrays.fill(perIterationResults, nonTransferTravelTimesToTargets[targetIdx] < cutoffSeconds); <START> if (perIterationResults[0]) { <END> reducer.accept(targetIdx, perIterationResults); continue; } TIntIntMap pointToStopDistanceTable = targets.pointToStopDistanceTables.get(targetIdx); boolean[] targetEverReached = new boolean[] { nonTransferTravelTimesToTargets[targetIdx] <= cutoffSeconds }; if (pointToStopDistanceTable != null) { for (int iteration = 0; iteration < perIterationResults.length; iteration++) { final int effectivelyFinalIteration = iteration; pointToStopDistanceTable.forEachEntry((stop, distanceMm) -> { int timeAtStop = travelTimesToStopsEachIteration[effectivelyFinalIteration][stop]; if (timeAtStop > cutoffSeconds) return true; int timeAtTargetThisStop = timeAtStop + distanceMm / speedMillimetersPerSecond; if (timeAtTargetThisStop < cutoffSeconds) { perIterationResults[effectivelyFinalIteration] = true; targetEverReached[0] = true; return false; } else { return true; } }); } } if (targetEverReached[0]) reducer.accept(targetIdx, perIterationResults); } long totalTimeMillis = System.currentTimeMillis() - startTimeMillis; LOG.info("Propagating iterations from stops to targets took {}s", travelTimesToStopsEachIteration.length, travelTimesToStopsEachIteration[0].length, targets.size(), totalTimeMillis / 1000d ); }</code><technical_language>Feels a bit weird testing zeroth in array get filled with. prefer calculate boolean reachableWithoutTransit = nonTransferTravelTimesToTargets[targetIdx] < cutoffSeconds; fill array conditionally continue; based of boolean</technical_language>

Target:
public void propagate (Reducer reducer) { targets.makePointToStopDistanceTablesIfNeeded(); long startTimeMillis = System.currentTimeMillis(); int speedMillimetersPerSecond = (int) (request.walkSpeed * 1000); for (int targetIdx = 0; targetIdx < targets.size(); targetIdx++) { boolean[] perIterationResults = new boolean[travelTimesToStopsEachIteration.length]; boolean targetReachedWithoutTransit = nonTransferTravelTimesToTargets[targetIdx] < cutoffSeconds; Arrays.fill(perIterationResults, targetReachedWithoutTransit); if (targetReachedWithoutTransit) { reducer.accept(targetIdx, perIterationResults); continue; } TIntIntMap pointToStopDistanceTable = targets.pointToStopDistanceTables.get(targetIdx); boolean[] targetEverReached = new boolean[] { nonTransferTravelTimesToTargets[targetIdx] <= cutoffSeconds }; if (pointToStopDistanceTable != null) { for (int iteration = 0; iteration < perIterationResults.length; iteration++) { final int effectivelyFinalIteration = iteration; pointToStopDistanceTable.forEachEntry((stop, distanceMillimeters) -> { int timeAtStop = travelTimesToStopsEachIteration[effectivelyFinalIteration][stop]; if (timeAtStop > cutoffSeconds) return true; int timeAtTargetThisStop = timeAtStop + distanceMillimeters / speedMillimetersPerSecond; if (timeAtTargetThisStop < cutoffSeconds) { perIterationResults[effectivelyFinalIteration] = true; targetEverReached[0] = true; return false; } else { return true; } }); } } if (targetEverReached[0]) reducer.accept(targetIdx, perIterationResults); } long totalTimeMillis = System.currentTimeMillis() - startTimeMillis; LOG.info("Propagating iterations from stops to targets took {}s", travelTimesToStopsEachIteration.length, travelTimesToStopsEachIteration[0].length, targets.size(), totalTimeMillis / 1000d ); }