Tools: small optimization- change find to in
authorTaapat <taapat@gmail.com>
Sat, 26 Oct 2013 18:57:51 +0000 (21:57 +0300)
committerMirakels <mirakels@openpli.org>
Sun, 27 Oct 2013 14:28:58 +0000 (15:28 +0100)
Signed-off-by: Mirakels <mirakels@openpli.org>

lib/python/Tools/GetEcmInfo.py
lib/python/Tools/HardwareInfo.py

index 56c6718..4ae7813 100644 (file)
@@ -101,7 +101,7 @@ class GetEcmInfo:
                                                info['provid'] = info['prov'][2:]
                                                time = ""
                                                for line in ecm:
-                                                       if line.find('msec') != -1:
+                                                       if 'msec' in line:
                                                                line = line.split(' ')
                                                                if line[0]:
                                                                        time = " (%ss)" % (float(line[0])/1000)
index a26264c..d364475 100644 (file)
@@ -25,13 +25,13 @@ class HardwareInfo:
                        print "fallback to detect hardware via /proc/cpuinfo!!"
                        try:
                                rd = open("/proc/cpuinfo", "r").read()
-                               if rd.find("Brcm4380 V4.2") != -1:
+                               if "Brcm4380 V4.2" in rd:
                                        HardwareInfo.device_name = "dm8000"
                                        print "dm8000 detected!"
-                               elif rd.find("Brcm7401 V0.0") != -1:
+                               elif "Brcm7401 V0.0" in rd:
                                        HardwareInfo.device_name = "dm800"
                                        print "dm800 detected!"
-                               elif rd.find("MIPS 4KEc V4.8") != -1:
+                               elif "MIPS 4KEc V4.8" in rd:
                                        HardwareInfo.device_name = "dm7025"
                                        print "dm7025 detected!"
                        except: