Iterate over the file object

Since the file is being iterated over already, calling readlines() is
unnecessary. It also increases memory usage by reading the file into memory
and then iterating over that.
This commit is contained in:
Sam Doran 2026-02-06 10:28:24 -05:00
parent 994652924f
commit 1d80283efa
No known key found for this signature in database
GPG key ID: 01602635F94328AA

View file

@ -3140,7 +3140,7 @@ class BusyBox(User):
with open("/etc/shells", "r") as f:
shells = [
shell
for shell in (line.strip() for line in f.readlines())
for shell in (line.strip() for line in f)
if shell
and not shell.startswith("#")
]