summaryrefslogtreecommitdiff
path: root/decoders/edid
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2018-08-29 20:44:17 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2018-08-29 20:45:49 +0200
commita27981c145cd9a3709673339dc455f3a0d5c3745 (patch)
tree9361129d5200428c7c2845a9d7121740d0ff6d33 /decoders/edid
parentef7b15889de43ddd9d46aa53c86e29ee6e5999a8 (diff)
downloadlibsigrokdecode-a27981c145cd9a3709673339dc455f3a0d5c3745.tar.gz
libsigrokdecode-a27981c145cd9a3709673339dc455f3a0d5c3745.zip
edid: Shorten two code snippets.
Diffstat (limited to 'decoders/edid')
-rw-r--r--decoders/edid/pd.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/decoders/edid/pd.py b/decoders/edid/pd.py
index 91db4b8..034c314 100644
--- a/decoders/edid/pd.py
+++ b/decoders/edid/pd.py
@@ -267,10 +267,7 @@ class Decoder(srd.Decoder):
def ann_field(self, start, end, annotation):
annotation = annotation if isinstance(annotation, list) else [annotation]
- if self.extension:
- sn = self.ext_sn[self.extension - 1]
- else:
- sn = self.sn
+ sn = self.ext_sn[self.extension - 1] if self.extension else self.sn
self.put(sn[start][0], sn[end][1],
self.out_ann, [ANN_FIELDS, annotation])
@@ -525,10 +522,7 @@ class Decoder(srd.Decoder):
self.ann_field(offset+3, offset+3, "Tag: {0:X}".format(tag))
self.ann_field(offset+4, offset+4, "Flag")
- if self.extension:
- sn = self.ext_sn[extension - 1]
- else:
- sn = self.sn
+ sn = self.ext_sn[self.extension - 1] if self.extension else self.sn
if tag == 0xff:
# Monitor serial number