Commit 2e9da602 authored by Raymond Hettinger's avatar Raymond Hettinger

The previous change works much faster (one lookup per key) when

iteritems() is defined.
parent 91dd19db
...@@ -154,6 +154,15 @@ class _DBWithCursor(UserDict.DictMixin): ...@@ -154,6 +154,15 @@ class _DBWithCursor(UserDict.DictMixin):
except _bsddb.DBNotFoundError: except _bsddb.DBNotFoundError:
return return
def iteritems(self):
try:
yield self.first()
next = self.next
while 1:
yield next()
except _bsddb.DBNotFoundError:
return
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# Compatibility object factory functions # Compatibility object factory functions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment