summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-21 21:14:56 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-21 21:14:56 +0000
commitac67750451afe6c33d75553906839b28c9077230 (patch)
tree2b4b825a98c110c5106b8c8bb67c1817d8059727
parent46224ed3874b469c38ea5e973b1e5faf5483b376 (diff)
downloadportage-ac67750451afe6c33d75553906839b28c9077230.tar.gz
portage-ac67750451afe6c33d75553906839b28c9077230.tar.bz2
portage-ac67750451afe6c33d75553906839b28c9077230.zip
Simplify the implementation of config.__iter__ and also implement iterkeys().
svn path=/main/trunk/; revision=6919
-rw-r--r--pym/portage/__init__.py10
1 files changed, 5 insertions, 5 deletions
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"