From c1f1947ca51848337051b41c6a48a5ecb3b1d553 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 10 Dec 2006 06:35:24 +0000 Subject: [PATCH] Avoid unnecessary dbapi.cp_list() calls inside cpv_expand(). svn path=/main/trunk/; revision=5249 --- pym/portage.py | 4 ++-- 1 file 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]: -- 2.26.2