mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
stdpy: fix bad performance reading all data from file
See Moguri/panda3d-gltf#31
This commit is contained in:
parent
c6990b9f9b
commit
099be1f652
@ -247,13 +247,13 @@ class StreamIOWrapper(io.IOBase):
|
||||
self.__stream.clear() # clear eof flag
|
||||
self.__lastWrite = False
|
||||
if size is not None and size >= 0:
|
||||
result = self.__reader.extractBytes(size)
|
||||
return self.__reader.extractBytes(size)
|
||||
else:
|
||||
# Read to end-of-file.
|
||||
result = b''
|
||||
result = bytearray()
|
||||
while not self.__stream.eof():
|
||||
result += self.__reader.extractBytes(512)
|
||||
return result
|
||||
result += self.__reader.extractBytes(4096)
|
||||
return bytes(result)
|
||||
|
||||
read1 = read
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user