mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00: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:
committed by
Michael DeHaan
parent
a7da5d8702
commit
0749112286
@@ -33,7 +33,7 @@ class ActionModule(object):
|
||||
module_name = 'command'
|
||||
module_args += " #USE_SHELL"
|
||||
|
||||
if tmp.find("tmp") == -1:
|
||||
if "tmp" not in tmp:
|
||||
tmp = self.runner._make_tmp_path(conn)
|
||||
|
||||
(module_path, is_new_style, shebang) = self.runner._copy_module(conn, tmp, module_name, module_args, inject, complex_args=complex_args)
|
||||
|
||||
Reference in New Issue
Block a user