mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -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
|
@ -1081,7 +1081,7 @@ def get_config_ip_commands(delta, interface, existing, version):
|
|||
# loop used in the situation that just an IP address or just a
|
||||
# mask is changing, not both.
|
||||
for each in ['addr', 'mask']:
|
||||
if each not in delta.keys():
|
||||
if each not in delta:
|
||||
delta[each] = existing[each]
|
||||
|
||||
if version == 'v4':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue