Skip to content

Commit 7b2b7d3

Browse files
committed
Reduce two read_byte calls to read_short.
1 parent 1b4240f commit 7b2b7d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sc2reader/parsers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ def parse_ability_event(self, buffer, frames, type, code, pid):
7878

7979
if atype & 0x20: # command card
8080
end = buffer.peek(35)
81-
ability = buffer.read_byte() << 8 | buffer.read_byte()
82-
81+
ability = buffer.read_short()
82+
8383
if flag in (0x29, 0x19, 0x14): # cancels
8484
# creation autoid number / object id
8585
ability = ability << 8 | buffer.read_byte()
@@ -219,7 +219,7 @@ def parse_ability_event(self, buffer, frames, type, code, pid):
219219

220220
if atype & 0x20: # command card
221221
end = buffer.peek(35)
222-
ability = buffer.read_byte() << 8 | buffer.read_byte()
222+
ability = buffer.read_short()
223223

224224
if flag in (0x29, 0x19, 0x14, 0x0c): # cancels
225225
# creation autoid number / object id

0 commit comments

Comments
 (0)