diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-05-09 01:49:28 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-05-09 01:49:28 +0000 |
commit | f16b2b2183f22282727fc485cbc9ce715a72c857 (patch) | |
tree | 9c8a790deda74f21ef3819dc2ee54c0b1db555a3 /bin/emerge | |
parent | 268884f1ef39987f1c8b9f0354e6b5e819f3aaa3 (diff) | |
download | portage-f16b2b2183f22282727fc485cbc9ce715a72c857.tar.gz portage-f16b2b2183f22282727fc485cbc9ce715a72c857.tar.bz2 portage-f16b2b2183f22282727fc485cbc9ce715a72c857.zip |
Optimize BlockerDB.findInstalledBlockers() so that it doesn't unnecessarily
try to match packages against an empty set of blocker atoms. (trunk r10254)
svn path=/main/branches/2.1.2/; revision=10255
Diffstat (limited to 'bin/emerge')
-rwxr-xr-x | bin/emerge | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/bin/emerge b/bin/emerge index ec395c6d2..02bcffc10 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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 |