From e1fca86cf82f0616e292dd5b0375d43fa2e61a48 Mon Sep 17 00:00:00 2001 From: Ishigh1 Date: Wed, 27 Aug 2025 02:36:47 +0200 Subject: [PATCH] Core: Improved GER's caching of visited nodes during initialization (#5366) * Moved the visited update * Renamed visited to seen --- entrance_rando.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/entrance_rando.py b/entrance_rando.py index 492fff32..578059ae 100644 --- a/entrance_rando.py +++ b/entrance_rando.py @@ -74,13 +74,12 @@ class EntranceLookup: if entrance in self._expands_graph_cache: return self._expands_graph_cache[entrance] - visited = set() + seen = {entrance.connected_region} q: deque[Region] = deque() q.append(entrance.connected_region) while q: region = q.popleft() - visited.add(region) # check if the region itself is progression if region in region.multiworld.indirect_connections: @@ -103,7 +102,8 @@ class EntranceLookup: and exit_ in self._usable_exits): self._expands_graph_cache[entrance] = True return True - elif exit_.connected_region and exit_.connected_region not in visited: + elif exit_.connected_region and exit_.connected_region not in seen: + seen.add(exit_.connected_region) q.append(exit_.connected_region) self._expands_graph_cache[entrance] = False