From cf85bb6901c310cbc6c59eaa3bcb4c78b5fd1709 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Fri, 17 May 2024 23:05:32 -0700 Subject: [PATCH] feat: GC only if there's something to gc --- pantograph/server.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pantograph/server.py b/pantograph/server.py index 80e95f9..63037c7 100644 --- a/pantograph/server.py +++ b/pantograph/server.py @@ -77,11 +77,9 @@ class Server: Must be called periodically. """ - self.run('goal.delete', {'stateIds': self.to_remove_goal_states}) - self.to_remove_goal_states.clear() - - def reset(self): - return self.run("reset", {}) + if self.to_remove_goal_states: + self.run('goal.delete', {'stateIds': self.to_remove_goal_states}) + self.to_remove_goal_states.clear() def expr_type(self, expr: str) -> Expr: """