Skip to content

Commit e1a1f95

Browse files
committed
a_star.py: streamline reading into byte_list
1 parent 433d1ae commit e1a1f95

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pi/a_star.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ def read_unpack(self, address, size, format):
2020

2121
self.bus.write_byte(20, address)
2222
time.sleep(0.0001)
23-
byte_list = []
24-
for n in range(0,size):
25-
byte_list.append(self.bus.read_byte(20))
23+
byte_list = [self.bus.read_byte(20) for _ in range(size)]
2624
return struct.unpack(format, bytes(byte_list))
2725

2826
def write_pack(self, address, format, *data):

0 commit comments

Comments
 (0)