summaryrefslogtreecommitdiffstats
path: root/pym/cache/metadata_overlay.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-22 02:50:33 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-22 02:50:33 +0000
commite5145157dbdb9c2683d1ab8176641f19d2dc5d4e (patch)
treebb858e72885b464b80e22ad228d158376c46307a /pym/cache/metadata_overlay.py
parent817be01f9ea3e703a861e4ec8ade82683903232a (diff)
downloadportage-e5145157dbdb9c2683d1ab8176641f19d2dc5d4e.tar.gz
portage-e5145157dbdb9c2683d1ab8176641f19d2dc5d4e.tar.bz2
portage-e5145157dbdb9c2683d1ab8176641f19d2dc5d4e.zip
Implement iterkeys on top of __iter__ instead of vice versa. Thanks to Brian Harring for the suggestion. (trunk r6918)
svn path=/main/branches/2.1.2/; revision=6934
Diffstat (limited to 'pym/cache/metadata_overlay.py')
-rw-r--r--pym/cache/metadata_overlay.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pym/cache/metadata_overlay.py b/pym/cache/metadata_overlay.py
index d82ba96f8..d2a0b27fe 100644
--- a/pym/cache/metadata_overlay.py
+++ b/pym/cache/metadata_overlay.py
@@ -75,14 +75,14 @@ class database(template.database):
return False
return True
- def iterkeys(self):
+ def __iter__(self):
s = set()
- for cpv in self.db_rw.iterkeys():
- if self.has_key(cpv): # validates whiteout when necessary
+ for cpv in self.db_rw:
+ if cpv in self: # validates whiteout when necessary
yield cpv
# set includes whiteouts so they won't be yielded later
s.add(cpv)
- for cpv in self.db_ro.iterkeys():
+ for cpv in self.db_ro:
if cpv not in s:
yield cpv