Use the return value from setdefault to avoid an extra dict lookup.
authorZac Medico <zmedico@gentoo.org>
Thu, 21 Dec 2006 02:45:02 +0000 (02:45 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 21 Dec 2006 02:45:02 +0000 (02:45 -0000)
svn path=/main/trunk/; revision=5344

pym/portage.py

index 22479c1f9747c3f94ede189a3569238b788514e8..5cceb6556d56dcbf9812d4ea8bd0c6539cb9bd35 100644 (file)
@@ -5422,8 +5422,7 @@ class portdbapi(dbapi):
 
                if cache_me:
                        aux_cache = {}
-                       mydata.setdefault("EAPI", "0")
-                       if not mydata["EAPI"]:
+                       if not mydata.setdefault("EAPI", "0"):
                                mydata["EAPI"] = "0"
                        for x in self._aux_cache_keys:
                                aux_cache[x] = mydata.get(x, "")