Optimize BlockerDB.findInstalledBlockers() so that it doesn't unnecessarily
authorZac Medico <zmedico@gentoo.org>
Fri, 9 May 2008 01:49:28 +0000 (01:49 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 9 May 2008 01:49:28 +0000 (01:49 -0000)
try to match packages against an empty set of blocker atoms. (trunk r10254)

svn path=/main/branches/2.1.2/; revision=10255

bin/emerge

index ec395c6d269a5626691592e55c1dfb58068b12ad..02bcffc10f5e2fe2f51d24481739d82b5900eb51 100755 (executable)
@@ -1750,13 +1750,14 @@ class BlockerDB(object):
 
                blocker_atoms = [atom[1:] for atom in atoms \
                        if atom.startswith("!")]
-               blocker_atoms = InternalPackageSet(initial_atoms=blocker_atoms)
-               for inst_pkg in installed_pkgs:
-                       try:
-                               blocker_atoms.iterAtomsForPackage(inst_pkg).next()
-                       except (portage_exception.InvalidDependString, StopIteration):
-                               continue
-                       blocking_pkgs.add(inst_pkg)
+               if blocker_atoms:
+                       blocker_atoms = InternalPackageSet(initial_atoms=blocker_atoms)
+                       for inst_pkg in installed_pkgs:
+                               try:
+                                       blocker_atoms.iterAtomsForPackage(inst_pkg).next()
+                               except (portage_exception.InvalidDependString, StopIteration):
+                                       continue
+                               blocking_pkgs.add(inst_pkg)
 
                return blocking_pkgs