]> sigrok.org Git - libsigrokdecode.git/commitdiff
lin: Simplify LinFsm._transition_allowed().
authorUwe Hermann <redacted>
Sun, 21 Oct 2018 17:28:31 +0000 (19:28 +0200)
committerUwe Hermann <redacted>
Sun, 21 Oct 2018 17:28:31 +0000 (19:28 +0200)
decoders/lin/pd.py

index d1c14814b681ea0563146d68f334645a47c10148..e82acf41fc09294d46bf3a9275daeb8c580d35fa 100644 (file)
@@ -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