~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lru_cache.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-04-16 15:25:00 UTC
  • mfrom: (4294.1.1 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090416152500-83w2bul0hwhhm7gd
(jam) Remove _LRUNode from the linked list as well as the dict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
235
235
        if self._last_recently_used is None:
236
236
            self._most_recently_used = None
237
237
        node.run_cleanup()
 
238
        # Now remove this node from the linked list
 
239
        if node.prev is not None:
 
240
            node.prev.next = node.next
 
241
        if node.next is not None:
 
242
            node.next.prev = node.prev
 
243
        # And remove this node's pointers
 
244
        node.prev = None
 
245
        node.next = None
238
246
 
239
247
    def _remove_lru(self):
240
248
        """Remove one entry from the lru, and handle consequences.