]> sigrok.org Git - libsigrokdecode.git/commitdiff
srd: UART: Simplify a code snippet.
authorUwe Hermann <redacted>
Wed, 7 Dec 2011 18:45:40 +0000 (19:45 +0100)
committerUwe Hermann <redacted>
Sat, 10 Dec 2011 19:01:44 +0000 (20:01 +0100)
decoders/uart.py

index efc1756149e568f5d0c57048396b355c1939af27..a089aa13195ca9cbc118247159ba1d74d93404d6 100644 (file)
@@ -370,9 +370,7 @@ class Decoder(sigrok.Decoder):
     # TODO: Currently only supports 1 stop bit.
     def get_stop_bits(self, signal):
         # Skip samples until we're in the middle of the stop bit(s).
-        skip_parity = 0
-        if self.parity != PARITY_NONE:
-            skip_parity = 1
+        skip_parity = 0 if self.parity == PARITY_NONE else 1
         if not self.reached_bit(self.num_data_bits + 1 + skip_parity):
             return []