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:
Dag Wieers 2016-11-17 15:19:14 +01:00 committed by Matt Clay
parent c843eeabc2
commit 54fdff16db
9 changed files with 10 additions and 10 deletions

View file

@ -852,7 +852,7 @@ def get_existing(module, prefix, warnings):
group_route = match_route.groupdict()
for key in key_map:
if key not in group_route.keys():
if key not in group_route:
group_route[key] = ''
group_route['prefix'] = prefix
group_route['vrf'] = module.params['vrf']