From bfb8d232165deda28c4651940dbef3bb7426c434 Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Mon, 15 Jul 2024 12:22:55 +0300 Subject: [PATCH] Cache get_asset_names_in_folder Significantly speed-ups DoorPatches --- src/open_samus_returns_rando/patcher_editor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/open_samus_returns_rando/patcher_editor.py b/src/open_samus_returns_rando/patcher_editor.py index e877c31..9df5808 100644 --- a/src/open_samus_returns_rando/patcher_editor.py +++ b/src/open_samus_returns_rando/patcher_editor.py @@ -1,4 +1,5 @@ import copy +import functools import typing from pathlib import Path @@ -74,6 +75,7 @@ def remove_entity(self, reference: dict)-> None: scenario.raw.actors[layer].pop(actor_name) scenario.remove_actor_from_all_groups(actor_name) + @functools.cache def get_asset_names_in_folder(self, folder: str) -> typing.Iterator[str]: yield from ( name