mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-13 03:44:02 -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
b79bf14607
commit
1ca4add91c
7 changed files with 15 additions and 15 deletions
|
@ -609,7 +609,7 @@ class DockerInventory(object):
|
|||
|
||||
self.groups[id].append(name)
|
||||
self.groups[name].append(name)
|
||||
if short_id not in self.groups.keys():
|
||||
if short_id not in self.groups:
|
||||
self.groups[short_id].append(name)
|
||||
self.groups[hostname].append(name)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue