mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 14:01:57 -09:00
support/scripts/pkg-stats: don't buffer whole file searching for infra
The file handle can be iterated over directly and each line is used exactly once, so the only effect of reading all lines into a list first was higher memory use and complexity. Signed-off-by: Fiona Klute <fiona.klute@gmx.de> Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
This commit is contained in:
committed by
Arnout Vandecappelle
parent
e8dcebf459
commit
07f7ad9898
@@ -197,8 +197,7 @@ class Package:
|
|||||||
|
|
||||||
self.infras = list()
|
self.infras = list()
|
||||||
with open(self.pkgfile, 'r') as f:
|
with open(self.pkgfile, 'r') as f:
|
||||||
lines = f.readlines()
|
for line in f:
|
||||||
for line in lines:
|
|
||||||
match = INFRA_RE.match(line)
|
match = INFRA_RE.match(line)
|
||||||
if not match:
|
if not match:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user