mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-08 00:20:38 -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()
|
||||
with open(self.pkgfile, 'r') as f:
|
||||
lines = f.readlines()
|
||||
for line in lines:
|
||||
for line in f:
|
||||
match = INFRA_RE.match(line)
|
||||
if not match:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user