mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 22:11:59 -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>
(cherry picked from commit 07f7ad9898)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
committed by
Thomas Perale
parent
5c5c8f4b08
commit
0b36bd22e8
@@ -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