mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 19:20:22 -07:00
Micro-optimization: replace s.find(x)!=-1 with x in s
timeit shows a speedup of ~3x on Python 2.7.5 x86_64. It also makes the code a bit shorter.
This commit is contained in:
parent
a7da5d8702
commit
0749112286
19 changed files with 50 additions and 48 deletions
|
@ -180,7 +180,7 @@ class CommandModule(AnsibleModule):
|
|||
params['removes'] = None
|
||||
params['shell'] = False
|
||||
params['executable'] = None
|
||||
if args.find("#USE_SHELL") != -1:
|
||||
if "#USE_SHELL" in args:
|
||||
args = args.replace("#USE_SHELL", "")
|
||||
params['shell'] = True
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue