From 208c27aa20166987961c47fea348eb8d0ad24915 Mon Sep 17 00:00:00 2001 From: Sasha Vezhnevets Date: Tue, 5 Dec 2023 08:32:07 -0800 Subject: [PATCH] Remove dead code from the GM. update_from_event is writing its own memories and returns none. PiperOrigin-RevId: 588081410 Change-Id: I9643ddf6f5aeea446acb4669fba26bb5fbb210e8 --- concordia/environment/game_master.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/concordia/environment/game_master.py b/concordia/environment/game_master.py index 2caf7f9c..0a053a7b 100644 --- a/concordia/environment/game_master.py +++ b/concordia/environment/game_master.py @@ -202,24 +202,12 @@ def update_from_player(self, player_name: str, action_attempt: str): def get_externality(externality): return externality.update_after_event(event_statement) - consequences = [] if self._concurrent_externalities: with concurrent.futures.ThreadPoolExecutor() as executor: - for result in executor.map( - get_externality, list(self._components.values())): - if result: - consequences.extend(result) + executor.map(get_externality, self._components.values()) else: for externality in self._components.values(): - result = externality.update_after_event(event_statement) - if result: - consequences.extend(result) - - for fact in consequences: - if fact: - if self._verbose: - self._print(fact, 'white') - self._memory.add(fact) # could be multi-threaded, helps with importance + externality.update_after_event(event_statement) self._last_chain = prompt