mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE][Ez]: FURB129: remove unneeded readlines() (#119796)
Applies a refurb rule to remove any readlines() in a for loop iteration as it just creates a temporary list in memory. Pull Request resolved: https://github.com/pytorch/pytorch/pull/119796 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
3319dbcd23
commit
f9200c8608
@ -39,7 +39,7 @@ Tried the following paths, but none existed:
|
||||
def repair_depfile(depfile: TextIO, include_dirs: List[Path]) -> None:
|
||||
changes_made = False
|
||||
out = ""
|
||||
for line in depfile.readlines():
|
||||
for line in depfile:
|
||||
if ":" in line:
|
||||
colon_pos = line.rfind(":")
|
||||
out += line[: colon_pos + 1]
|
||||
|
Reference in New Issue
Block a user