~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lru_cache.py

  • Committer: Robert Collins
  • Date: 2008-02-13 03:30:01 UTC
  • mfrom: (3221 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3224.
  • Revision ID: robertc@robertcollins.net-20080213033001-rw70ul0zb02ph856
Merge to fix conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
            # Trigger the cleanup
70
70
            self.cleanup()
71
71
 
 
72
    def get(self, key, default=None):
 
73
        if key in self._cache:
 
74
            return self[key]
 
75
        return default
 
76
 
72
77
    def cleanup(self):
73
78
        """Clear the cache until it shrinks to the requested size.
74
79