cleanup: Very small refactor for stripgbc (#5)

This commit is contained in:
FexCollects 2024-12-29 13:11:46 -07:00 committed by GitHub
parent 128dc8fc12
commit ab883b0717
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,9 +13,11 @@ with open(sys.argv[1], 'rb') as f:
# the program shall end with $FF followed only by $00 bytes
# for every $FF we hit, buffer until something that isnt $00
if (not buffering and ord(byte) == 0xFF) or (buffering and ord(byte) == 0x00):
if not buffering and ord(byte) == 0xFF:
buf += byte
buffering = True
elif buffering and ord(byte) == 0x00:
buf += byte
elif buffering and ord(byte) == 0xFF:
out.write(buf)
buf = byte