Skip to content

Commit

Permalink
refactor: simplify code to get values in condition
Browse files Browse the repository at this point in the history
  • Loading branch information
hollandjg committed May 24, 2024
1 parent 785a91f commit c5ade53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/autora/state_history_delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c5ade53

Please sign in to comment.