mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 04:41: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
|
@ -461,7 +461,7 @@ def create_instances(module, gce, instance_names, number):
|
|||
bad_perms = []
|
||||
if service_account_permissions:
|
||||
for perm in service_account_permissions:
|
||||
if perm not in gce.SA_SCOPES_MAP.keys():
|
||||
if perm not in gce.SA_SCOPES_MAP:
|
||||
bad_perms.append(perm)
|
||||
if len(bad_perms) > 0:
|
||||
module.fail_json(msg='bad permissions: %s' % str(bad_perms))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue