Changeset 9480 in josm for trunk/src/org
- Timestamp:
- 2016-01-16T03:00:56+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/MultipolygonBuilder.java
r9372 r9480 376 376 @Override 377 377 protected List<PolygonLevel> compute() { 378 if (to - from < directExecutionTaskSize) {378 if (to - from <= directExecutionTaskSize) { 379 379 return computeDirectly(); 380 380 } else { 381 381 final Collection<ForkJoinTask<List<PolygonLevel>>> tasks = new ArrayList<>(); 382 382 for (int fromIndex = from; fromIndex < to; fromIndex += directExecutionTaskSize) { 383 final List<PolygonLevel> output = new ArrayList<>(); 384 tasks.add(new Worker(input, fromIndex, Math.min(fromIndex + directExecutionTaskSize, to), output, directExecutionTaskSize)); 385 } 386 for (ForkJoinTask<List<PolygonLevel>> task : tasks) { 387 output.addAll(task.join()); 383 tasks.add(new Worker(input, fromIndex, Math.min(fromIndex + directExecutionTaskSize, to), new ArrayList<PolygonLevel>(), directExecutionTaskSize)); 384 } 385 for (ForkJoinTask<List<PolygonLevel>> task : ForkJoinTask.invokeAll(tasks)) { 386 List<PolygonLevel> res = task.join(); 387 if (res == null) { 388 return null; 389 } 390 output.addAll(res); 388 391 } 389 392 return output;
Note:
See TracChangeset
for help on using the changeset viewer.