-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use 'key in dict' instead of 'key in dict.keys()' #4017
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Drives me nuts.
I had some suggestions, if we're going to be fixing things anyway...
(Unfortunately, because they cross deleted lines in the diff, I couldn't leave them as actual suggestions that could be applied directly from the review interface.)
And here (which extended too far outside the diff to review-comment on at all)... openshot-qt/src/windows/views/files_treeview.py Lines 186 to 195 in c79d13f
that can all be just: f.data.update({"name": name or os.path.basename(f.data.get("path"))})
if "tags" in f.data or tags:
f.data.update({"tags": tags}) No real point in those inequality tests, when any inequality results in an assignment. The lookup to get the current value may be slightly cheaper than the assignment, but it's also completely redundant whenever we have to do the assignment. Might as well skip the test and just always assign. If it happens to be the same value it already held, what's the harm? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! One minor typo to fix, and then I'm good to merge. Thanks!
No description provided.