chiark / gitweb /
Don't need to use find()
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 17 Mar 2013 11:44:06 +0000 (12:44 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 17 Mar 2013 11:44:06 +0000 (12:44 +0100)
fdroidserver/common.py

index 2a0ea00c94b8e4f66983e0179b95ddfbc536b0e7..808d80cf4fc879d49baa78591b4def4e596784f2 100644 (file)
@@ -1961,14 +1961,14 @@ def scan_source(build_dir, root_dir, thisbuild):
     for r,d,f in os.walk(build_dir):
         for curfile in f:
 
-            if r.find('/.hg') != -1 or r.find('/.git') != -1:
+            if '/.hg' in r or '/.git' in r or '/.svn' in r:
                 continue
 
             # Path (relative) to the file...
             fp = os.path.join(r, curfile)
 
             for suspect in usual_suspects:
-                if curfile.lower().find(suspect) != -1:
+                if suspect in curfile.lower():
                     msg = 'Found probable non-free blob ' + fp
                     problems.append(msg)
 
@@ -1982,7 +1982,7 @@ def scan_source(build_dir, root_dir, thisbuild):
 
             elif curfile.endswith('.java'):
                 for line in file(fp):
-                    if line.find('DexClassLoader') != -1:
+                    if 'DexClassLoader' in line:
                         msg = 'Found DexClassLoader in ' + fp
                         problems.append(msg)