From bd1261e3404486b755a57753252f6fa2df3547bb Mon Sep 17 00:00:00 2001 From: steffenaxer <26229392+steffenaxer@users.noreply.github.com> Date: Mon, 25 Nov 2024 12:40:15 +0100 Subject: [PATCH] Remove redundant zoneToLinksMap --- .../zones/systems/grid/square/SquareGridZoneSystem.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/contribs/common/src/main/java/org/matsim/contrib/common/zones/systems/grid/square/SquareGridZoneSystem.java b/contribs/common/src/main/java/org/matsim/contrib/common/zones/systems/grid/square/SquareGridZoneSystem.java index f47ed5669c9..a017bc154e6 100644 --- a/contribs/common/src/main/java/org/matsim/contrib/common/zones/systems/grid/square/SquareGridZoneSystem.java +++ b/contribs/common/src/main/java/org/matsim/contrib/common/zones/systems/grid/square/SquareGridZoneSystem.java @@ -55,7 +55,6 @@ public class SquareGridZoneSystem implements GridZoneSystem { private final IdMap zones = new IdMap<>(Zone.class); - private final IdMap> zoneToLinksMap = new IdMap<>(Zone.class); private final Map> index2Links; private final Network network; @@ -114,7 +113,7 @@ public Optional getZoneForCoord(Coord coord) { @Override public List getLinksForZoneId(Id zone) { - return zoneToLinksMap.get(zone); + return this.index2Links.get(Integer.parseInt(zone.toString())); } private Optional getOrCreateZone(Coord coord) { @@ -129,12 +128,6 @@ private Optional getOrCreateZone(Coord coord) { if(zoneFilter.test(zone)) { internalZones[index] = zone; zones.put(zone.getId(), zone); - List linkList = zoneToLinksMap.computeIfAbsent(zone.getId(), zoneId -> new ArrayList<>()); - List links = index2Links.get(index); - if(links!=null) - { - linkList.addAll(links); - } } else { return Optional.empty(); }