summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-10 06:35:24 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-10 06:35:24 +0000
commitc1f1947ca51848337051b41c6a48a5ecb3b1d553 (patch)
treeb8b727846f8e1f8f51bc582e6ed156d670750abb /pym
parent14674418db73de2344a87c8d52b271c40574613f (diff)
downloadportage-c1f1947ca51848337051b41c6a48a5ecb3b1d553.tar.gz
portage-c1f1947ca51848337051b41c6a48a5ecb3b1d553.tar.bz2
portage-c1f1947ca51848337051b41c6a48a5ecb3b1d553.zip
Avoid unnecessary dbapi.cp_list() calls inside cpv_expand().
svn path=/main/trunk/; revision=5249
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py
index cb8463b2d..d84b6bcea 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -4025,10 +4025,10 @@ def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None):
mykey=myslash[0]+"/"+mysplit[0]
else:
mykey=mycpv
- if mydb:
+ if mydb and virts and mykey in virts:
writemsg("mydb.__class__: %s\n" % (mydb.__class__), 1)
if type(mydb)==types.InstanceType:
- if (not mydb.cp_list(mykey,use_cache=use_cache)) and virts and virts.has_key(mykey):
+ if not mydb.cp_list(mykey, use_cache=use_cache):
writemsg("virts[%s]: %s\n" % (str(mykey),virts[mykey]), 1)
mykey_orig = mykey[:]
for vkey in virts[mykey]: