summaryrefslogtreecommitdiffstats
path: root/test/Repository
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2019-08-30 13:59:29 (GMT)
committerMats Wichmann <mats@linux.com>2019-08-30 14:04:23 (GMT)
commit49212c0d8dc8db6657735036028948bf3ab9ede0 (patch)
tree08f0ea34bbc36d51a8234a72ea5fe65d3f44c68e /test/Repository
parent84843df640e34f83ebea25be851204f400a0d9ec (diff)
downloadSCons-49212c0d8dc8db6657735036028948bf3ab9ede0.zip
SCons-49212c0d8dc8db6657735036028948bf3ab9ede0.tar.gz
SCons-49212c0d8dc8db6657735036028948bf3ab9ede0.tar.bz2
Use "in" in preference to string find method
In places where only the found/not found status is needed, use the membership operator (in) for checks instead - makes for easier reading and is considered faster for shorter strings. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/Repository')
-rw-r--r--test/Repository/RMIC.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/Repository/RMIC.py b/test/Repository/RMIC.py
index aa4a57e..7c37dd9 100644
--- a/test/Repository/RMIC.py
+++ b/test/Repository/RMIC.py
@@ -37,7 +37,7 @@ test = TestSCons.TestSCons()
where_javac, java_version = test.java_where_javac()
-# Try to get the major/minor Java version
+# Try to get the major/minor Java version
curver = (1, 0)
if java_version.count('.') == 1:
# Check Java version
@@ -97,7 +97,7 @@ env = Environment(tools = ['javac', 'rmic'],
RMIC = r'"%s"')
classes = env.Java(target = 'classes', source = 'src')
# Brute-force removal of the "Hello" class.
-classes = [c for c in classes if str(c).find('Hello') == -1]
+classes = [c for c in classes if 'Hello' not in str(c)]
env.RMIC(target = 'outdir', source = classes)
""" % (javac, rmic))
@@ -365,7 +365,7 @@ env = Environment(tools = ['javac', 'rmic'],
RMIC = r'"%s"')
classes = env.Java(target = 'classes', source = 'src')
# Brute-force removal of the "Hello" class.
-classes = [c for c in classes if str(c).find('Hello') == -1]
+classes = [c for c in classes if 'Hello' not in str(c)]
rmi_classes = env.RMIC(target = 'outdir', source = classes)
Local(rmi_classes)
""" % (javac, rmic))