Core: Improved GER's caching of visited nodes during initialization (#5366)

* Moved the visited update

* Renamed visited to seen
This commit is contained in:
Ishigh1
2025-08-27 02:36:47 +02:00
committed by GitHub
parent 1fa342b085
commit e1fca86cf8

View File

@@ -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