mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Performance improvement using in-operator for hash lookups
Just a small cleanup for the existing occurrences. Using the in-operator for hash lookups is faster than using .has_key() http://stackoverflow.com/questions/1323410/has-key-or-in
This commit is contained in:
parent
85f6c26dff
commit
c843eeabc2
2 changed files with 3 additions and 3 deletions
|
@ -163,7 +163,7 @@ class Rhn(RegistrationBase):
|
|||
def get_option_default(self, key, default=''):
|
||||
# ignore pep8 W601 errors for this line
|
||||
# setting this to use 'in' does not work in the rhn library
|
||||
if self.has_key(key):
|
||||
if key in self:
|
||||
return self[key]
|
||||
else:
|
||||
return default
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue