From c5ade53145a988b744f512daf8f3f29720f8d3c7 Mon Sep 17 00:00:00 2001 From: John Gerrard Holland Date: Fri, 24 May 2024 13:15:05 -0400 Subject: [PATCH] refactor: simplify code to get values in condition --- src/autora/state_history_delta.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/autora/state_history_delta.py b/src/autora/state_history_delta.py index 26c14bbd..a58e1c80 100644 --- a/src/autora/state_history_delta.py +++ b/src/autora/state_history_delta.py @@ -500,8 +500,9 @@ def condition(entry): return False return True elif isinstance(entry, State): + value_dict = vars(entry) for key, value in kwargs.items(): - if not (hasattr(entry, key) and getattr(entry, key) == value): + if not value_dict.get(key, None) == value: return False return True else: