From c0ec3160239bee9aefe8fd1ac37ddd2588f7a311 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Tue, 16 Oct 2018 23:45:22 +0200 Subject: [PATCH] Use Python methods for ChkSum - speed bump. --- grmn/chksum.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grmn/chksum.py b/grmn/chksum.py index 1892705..8923c70 100644 --- a/grmn/chksum.py +++ b/grmn/chksum.py @@ -7,8 +7,7 @@ class ChkSum: self.last_byte = 0xff def add(self, data): - for c in data: - self.chksum += c + self.chksum += sum(bytearray(data)) self.last_byte = data[-1] self.chksum &= 0xff