diff options
author | Cristian Ciupitu <cristian.ciupitu@yahoo.com> | 2014-01-23 17:02:17 +0200 |
---|---|---|
committer | Michael DeHaan <michael.dehaan@gmail.com> | 2014-03-16 13:10:28 -0400 |
commit | 7f681c33a2a4b6f7d074468a039476c95974de04 (patch) | |
tree | 5baf33f5e60f7e55d97376d6ec75d1c6d15c7cfc /commands | |
parent | c3e8a51374545c895fb18fd40fa3fd1c9be187ee (diff) | |
download | ansible-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/command | 2 |
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 |