Skip to content
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

Checking if the key exists in dictionary instead of using dict.get(key, None) #298

Closed
mohitanand001 opened this issue May 28, 2019 · 1 comment

Comments

@mohitanand001
Copy link

if "shared_libs" in info:
minfo["shared_libs"] = info["shared_libs"]

if "shared_libs" in info:
cinfo["shared_libs"] = info["shared_libs"]

Some places in this file FAI-PEP/benchmarking/driver/benchmark_driver.py has check if a key is in the dictionary and then tries to access it. It may be inefficient and less clean to go through
the dictionary twice. Can I raise a PR to change these to

minfo["shared_libs"] = info.get("shared_libs", "") 
cinfo["shared_libs"] = info.get("shared_libs", "")
@sf-wind
Copy link
Contributor

sf-wind commented May 28, 2019

Please do, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants