summaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorCristian Ciupitu <cristian.ciupitu@yahoo.com>2014-01-23 17:02:17 +0200
committerMichael DeHaan <michael.dehaan@gmail.com>2014-03-16 13:10:28 -0400
commit7f681c33a2a4b6f7d074468a039476c95974de04 (patch)
tree5baf33f5e60f7e55d97376d6ec75d1c6d15c7cfc /commands
parentc3e8a51374545c895fb18fd40fa3fd1c9be187ee (diff)
downloadansible-modules-extras-7f681c33a2a4b6f7d074468a039476c95974de04.tar.gz
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.
Diffstat (limited to 'commands')
-rw-r--r--commands/command2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/command b/commands/command
index ba9ae30a..b35501f1 100644
--- a/commands/command
+++ b/commands/command
@@ -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