kopia lustrzana https://github.com/micropython/micropython-lib
utarfile: skip: Optimize for memory usage.
Propagated from upip_utarfile.py.pull/211/head
rodzic
417774d205
commit
2f5f428f7c
|
@ -39,7 +39,13 @@ class FileSection:
|
|||
return sz
|
||||
|
||||
def skip(self):
|
||||
self.f.read(self.content_len + self.align)
|
||||
sz = self.content_len + self.align
|
||||
if sz:
|
||||
buf = bytearray(16)
|
||||
while sz:
|
||||
s = min(sz, 16)
|
||||
self.f.readinto(buf, s)
|
||||
sz -= s
|
||||
|
||||
class TarInfo:
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue