From: Zac Medico Date: Thu, 21 Jun 2007 21:14:56 +0000 (-0000) Subject: Simplify the implementation of config.__iter__ and also implement iterkeys(). X-Git-Tag: v2.2_pre1~1198 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ac67750451afe6c33d75553906839b28c9077230;p=portage.git Simplify the implementation of config.__iter__ and also implement iterkeys(). svn path=/main/trunk/; revision=6919 --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index bf66dc4d2..bfc6f0839 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -2230,11 +2230,11 @@ class config(object): def __iter__(self): keys = set() for d in self.lookuplist: - for k in d: - if k in keys: - continue - keys.add(k) - yield k + keys.update(d) + return iter(keys) + + def iterkeys(self): + return iter(self) def __setitem__(self,mykey,myvalue): "set a value; will be thrown away at reset() time"