[BE]: Apply ruff PERF403 to use dict comprehensions more often (#149257)

Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/149257
Approved by: https://github.com/jansel
This commit is contained in:
Aaron Gokaslan
2025-03-18 00:46:07 +00:00
committed by PyTorch MergeBot
parent 811f587d86
commit a0ac63cbd9
23 changed files with 48 additions and 81 deletions

View File

@ -819,10 +819,9 @@ class GitHubPR:
cursor=info["reviews"]["pageInfo"]["startCursor"],
)
info = rc["data"]["repository"]["pullRequest"]
reviews = {}
for author, state in self._reviews:
if state != "COMMENTED":
reviews[author] = state
reviews = {
author: state for author, state in self._reviews if state != "COMMENTED"
}
return list(reviews.items())
def get_approved_by(self) -> list[str]: