Skip to content

Commit 78a5e14

Browse files
committed
Favour readability over performance for SOF check
1 parent ae2a64b commit 78a5e14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_pm25/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def read(self):
8383
# print([hex(i) for i in self._buffer])
8484

8585
# check packet header
86-
if (self._buffer[0] != 0x42) or (self._buffer[1] != 0x4D):
86+
if not self._buffer[0:2] == b'BM':
8787
raise RuntimeError("Invalid PM2.5 header")
8888

8989
# check frame length

0 commit comments

Comments
 (0)