Skip to content

Commit

Permalink
Set osmNoisyRoads field to null after clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
ratrun committed Sep 29, 2024
1 parent 4a4b580 commit 7fc4968
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ public List<OSMNoisyRoad> getOsmNoisyRoads() {
return osmNoisyRoads;
}

public void clearOsmNoisyRoads() {
osmNoisyRoads.clear();
osmNoisyRoads = null;
}

public static class LongToTwoIntsMap {
private final LongLongMap internalIdsByKey = new GHLongLongBTree(200, 4, -1);
private final IntArrayList vals1 = new IntArrayList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void buildOSMNoisyRoadIndex() {
}).collect(Collectors.toList());
// todonow remove toFootprint log lines
LOGGER.info(GraphLayout.parseInstance(osmNoisyRoadData, validRoads).toFootprint());
osmNoisyRoadData.getOsmNoisyRoads().clear();
osmNoisyRoadData.clearOsmNoisyRoads();
osmNoisyRoadNoiseIndex = new NoiseIndex<>(validRoads);
LOGGER.info(GraphLayout.parseInstance(osmNoisyRoadNoiseIndex).toFootprint());
// they partly overlap
Expand Down

0 comments on commit 7fc4968

Please sign in to comment.