mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-31 19:23:16 +03:00
Merge ddde1b8f9d
into 7e4d8e2f55
This commit is contained in:
commit
8bc1b8fbb5
|
@ -33,11 +33,7 @@ class BitStream:
|
|||
|
||||
def peek(self, bits: int) -> int:
|
||||
while self.bits < bits:
|
||||
c = self.next()
|
||||
if c < 0:
|
||||
self.bits = 0
|
||||
continue
|
||||
self.bitbuffer = (self.bitbuffer << 8) + c
|
||||
self.bitbuffer = (self.bitbuffer << 8) + self.next()
|
||||
self.bits += 8
|
||||
return self.bitbuffer >> (self.bits - bits) & (1 << bits) - 1
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user