From: Zac Medico Date: Sun, 10 Dec 2006 06:35:24 +0000 (-0000) Subject: Avoid unnecessary dbapi.cp_list() calls inside cpv_expand(). X-Git-Tag: v2.1.2~335 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c1f1947ca51848337051b41c6a48a5ecb3b1d553;p=portage.git Avoid unnecessary dbapi.cp_list() calls inside cpv_expand(). svn path=/main/trunk/; revision=5249 --- 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]: