- Timestamp:
- 2020-10-09T14:19:58+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
r16187 r17136 425 425 } 426 426 targetDataSet.update(() -> { 427 List<? extends OsmPrimitive> candidates = n ew ArrayList<>(targetDataSet.getNodes());427 List<? extends OsmPrimitive> candidates = null; 428 428 for (Node node: sourceDataSet.getNodes()) { 429 // lazy initialisation to improve performance, see #19898 430 if (candidates == null) { 431 candidates = new ArrayList<>(targetDataSet.getNodes()); 432 } 429 433 mergePrimitive(node, candidates); 430 434 if (progressMonitor != null) { … … 432 436 } 433 437 } 434 candidates.clear(); 435 candidates = new ArrayList<>(targetDataSet.getWays()); 438 candidates = null; 436 439 for (Way way: sourceDataSet.getWays()) { 440 // lazy initialisation to improve performance 441 if (candidates == null) { 442 candidates = new ArrayList<>(targetDataSet.getWays()); 443 } 437 444 mergePrimitive(way, candidates); 438 445 if (progressMonitor != null) { … … 440 447 } 441 448 } 442 candidates.clear(); 443 candidates = new ArrayList<>(targetDataSet.getRelations()); 449 candidates = null; 444 450 for (Relation relation: sourceDataSet.getRelations()) { 451 // lazy initialisation to improve performance 452 if (candidates == null) { 453 candidates = new ArrayList<>(targetDataSet.getRelations()); 454 } 445 455 mergePrimitive(relation, candidates); 446 456 if (progressMonitor != null) { … … 448 458 } 449 459 } 450 candidates .clear();460 candidates = null; 451 461 fixReferences(); 452 462 -
trunk/src/org/openstreetmap/josm/io/OsmServerBackreferenceReader.java
r16913 r17136 215 215 progressMonitor.beginTask(null, 2); 216 216 try { 217 Collection<Way> waysToCheck = new ArrayList<>(ds.getWays());218 217 if (isReadFull() || (primitiveType == OsmPrimitiveType.NODE && !isAllowIncompleteParentWays())) { 218 Collection<Way> waysToCheck = new ArrayList<>(ds.getWays()); 219 219 for (Way way: waysToCheck) { 220 220 if (!way.isNew() && way.hasIncompleteNodes()) {
Note:
See TracChangeset
for help on using the changeset viewer.