From: Uwe Hermann Date: Sun, 21 Oct 2018 17:28:31 +0000 (+0200) Subject: lin: Simplify LinFsm._transition_allowed(). X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b1e3616dd1b30c8c298c00728647bb72fc3c2c5a;p=libsigrokdecode.git lin: Simplify LinFsm._transition_allowed(). --- diff --git a/decoders/lin/pd.py b/decoders/lin/pd.py index d1c1481..e82acf4 100644 --- a/decoders/lin/pd.py +++ b/decoders/lin/pd.py @@ -37,10 +37,7 @@ class LinFsm: def _transition_allowed(self, target_state): if target_state == LinFsm.State.Error: return True - for s in self.allowed_state[self.state]: - if s == target_state: - return True - return False + return target_state in self.allowed_state[self.state] def reset(self): self.state = LinFsm.State.WaitForBreak