mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-09 01:44:03 -07:00
Performance improvement using in-operator on dicts
Just a small cleanup for the existing occurrences. Using the in-operator for hash lookups is faster than using .keys() http://stackoverflow.com/questions/29314269/why-do-key-in-dict-and-key-in-dict-keys-have-the-same-output
This commit is contained in:
parent
c843eeabc2
commit
54fdff16db
9 changed files with 10 additions and 10 deletions
|
@ -1418,7 +1418,7 @@ def state_present(module, existing, proposed, candidate):
|
|||
commands.append('no {0}'.format(key))
|
||||
|
||||
elif value == 'default':
|
||||
if key in PARAM_TO_DEFAULT_KEYMAP.keys():
|
||||
if key in PARAM_TO_DEFAULT_KEYMAP:
|
||||
commands.append('{0} {1}'.format(key, PARAM_TO_DEFAULT_KEYMAP[key]))
|
||||
|
||||
elif existing_commands.get(key):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue