mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00: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:
@@ -877,7 +877,7 @@ def latest(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos):
|
||||
# or virtual provides (like "python-*" or "smtp-daemon") while
|
||||
# updates contains name only.
|
||||
this_name_only = '-'.join(this.split('-')[:-2])
|
||||
if spec in pkgs['update'] and this_name_only in updates.keys():
|
||||
if spec in pkgs['update'] and this_name_only in updates:
|
||||
nothing_to_do = False
|
||||
will_update.add(spec)
|
||||
# Massage the updates list
|
||||
|
||||
Reference in New Issue
Block a user