[MERGE] Fix LRUNode referencing

Ian Clatworthy ian.clatworthy at canonical.com
Tue Apr 28 09:00:08 BST 2009


Ian Clatworthy has voted tweak.
Status is now: Conditionally approved
Comment:
This bit is wrong - you still want node.prev.key ...

-            prev = self.prev.key
+            prev_key = self.prev_key

This comment needs tweaking now that the code has moved ...

-        elif node is self._last_recently_used:
-            self._last_recently_used = node.prev
          # We've taken care of the tail pointer, remove the node, and 
insert it
          # at the front

s/We've taken/We take/.

As a minor change, you can also move self.cleanup = None inside the if 
block in LRUNode.run_cleanup().

I'd also prefer self._least_recently_used over self._last_recently_used 
but it's OK either way.

For details, see: 
http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C49E7AC69.5000703%40arbash-meinel.com%3E
Project: Bazaar



More information about the bazaar mailing list