Skip to contentSkip to conversation

cooker: use in instead of count

PATCH New Ross Burton 1 participant 1 message Dec 11, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cooker: use in instead of count

No point counting all instances when we just want to know if there's any or not.

---
 bitbake/lib/bb/cooker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bb/cooker.py +1 -1
index 4df8881..d39c64b 100644
@@ -1072,7 +1072,7 @@ class BBCooker:
 
         for pfn in self.recipecache.pkg_fn:
             inherits = self.recipecache.inherits.get(pfn, None)
-            if inherits and inherits.count(klass) > 0:
+            if inherits and klass in inherits:
                 pkg_list.append(self.recipecache.pkg_fn[pfn])
 
         return pkg_list
Signature · 1 line
2.1.4