From 7f7ea759ebdc854beb0468b410f7d2382f291a4f Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 1 Feb 2012 23:14:29 +0100 Subject: srd: Properly use append() for appending to lists. This is not only the canonical way to do it, it's also quite a bit faster and less memory-intensive than using '+='. --- decoders/transitioncounter/transitioncounter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'decoders/transitioncounter/transitioncounter.py') diff --git a/decoders/transitioncounter/transitioncounter.py b/decoders/transitioncounter/transitioncounter.py index 4b458b2..44dda48 100644 --- a/decoders/transitioncounter/transitioncounter.py +++ b/decoders/transitioncounter/transitioncounter.py @@ -96,7 +96,8 @@ class Decoder(srd.Decoder): # TODO: How to only output something after the last chunk of data? outdata = [] for i in range(self.channels): - outdata += [[self.transitions[i], self.rising[i], self.falling[i]]] + outdata.append([self.transitions[i], self.rising[i], + self.falling[i]]) if outdata != []: # self.put(0, 0, self.out_proto, out_proto) -- cgit v1.2.3-70-g09d2