mirror of https://github.com/jab/bidict.git
small optimization in OrderedBidictBase.__iter__
This commit is contained in:
parent
47abda458c
commit
b90821e365
|
@ -276,9 +276,9 @@ class OrderedBidictBase(BidictBase):
|
|||
|
||||
def __iter__(self, reverse=False):
|
||||
"""An iterator over this bidict's items in order."""
|
||||
fwdm = self._fwdm
|
||||
fwdm_inv = self._fwdm.inverse
|
||||
for node in self._sntl.__iter__(reverse=reverse):
|
||||
yield fwdm.inverse[node]
|
||||
yield fwdm_inv[node]
|
||||
|
||||
def __reversed__(self):
|
||||
"""An iterator over this bidict's items in reverse order."""
|
||||
|
|
Loading…
Reference in New Issue