small optimization in OrderedBidictBase.__iter__

This commit is contained in:
jab 2019-02-25 02:07:28 +00:00
parent 47abda458c
commit b90821e365
1 changed files with 2 additions and 2 deletions

View File

@ -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."""