summaryrefslogtreecommitdiffstats
path: root/pym/_emerge
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-05-10 21:03:02 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-10 21:03:02 -0700
commitbd78d51c715b711a5d496d68bb48421b777bf609 (patch)
tree1489aa79a2f4ab871daeb36652ab3f7df46bde77 /pym/_emerge
parent93e7c03d9a09ec61931bb4e8f4fdf4e4083ac19c (diff)
downloadportage-bd78d51c715b711a5d496d68bb48421b777bf609.tar.gz
portage-bd78d51c715b711a5d496d68bb48421b777bf609.tar.bz2
portage-bd78d51c715b711a5d496d68bb48421b777bf609.zip
dep_check_composite_db: return early from cp_list
Since this implementation is only intended to check for existence of new-style virtuals, it's a waste of time to return more than one cpv.
Diffstat (limited to 'pym/_emerge')
-rw-r--r--pym/_emerge/depgraph.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 6c79819d2..b8089ae96 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6051,7 +6051,9 @@ class _dep_check_composite_db(dbapi):
def cp_list(self, cp):
"""
Emulate cp_list just so it can be used to check for existence
- of new-style virtuals.
+ of new-style virtuals. Since it's a waste of time to return
+ more than one cpv for this use case, a maximum of one cpv will
+ be returned.
"""
if isinstance(cp, Atom):
atom = cp
@@ -6062,6 +6064,7 @@ class _dep_check_composite_db(dbapi):
self._depgraph._frozen_config.roots[self._root], atom):
if pkg.cp == cp:
ret.append(pkg.cpv)
+ break
return ret