From: Fredrik Tolf Date: Mon, 30 Mar 2015 01:13:41 +0000 (+0200) Subject: Fixed index bugs. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=a48a2d5dfa2869f715d8a79663a16703fc50fb9a;p=didex.git Fixed index bugs. --- diff --git a/didex/index.py b/didex/index.py index 30dcfdf..2844de0 100644 --- a/didex/index.py +++ b/didex/index.py @@ -155,7 +155,7 @@ class ordered(index, lib.closable): def _decode(self, d): k, v = d - k = self.type.decode(k) + k = self.typ.decode(k) v = struct.unpack(">Q", v)[0] return k, v @@ -212,13 +212,13 @@ class ordered(index, lib.closable): self.item = StopIteration def __next__(self): - if self.item is StopIteration: - raise StopIteration() if self.item is None: if not self.rev: self.next() else: self.prev() + if self.item is StopIteration: + raise StopIteration() ret, self.item = self.item, None return ret