utarfile: skip: Optimize for memory usage.

Propagated from upip_utarfile.py.
pull/211/head
Paul Sokolovsky 2017-09-29 18:11:30 -07:00
rodzic 417774d205
commit 2f5f428f7c
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -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: