Mercurial > hg
comparison mercurial/util.py @ 29828:79add5a4e857
util: properly implement lrucachedict.get()
Before, it was returning the raw _lrucachenode instance instead of its
value.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 22 Aug 2016 20:30:37 -0700 |
parents | 279cd80059d4 |
children | bac1829ec31f |
comparison
equal
deleted
inserted
replaced
29827:a22b3de3b65a | 29828:79add5a4e857 |
---|---|
649 | 649 |
650 # Additional dict methods. | 650 # Additional dict methods. |
651 | 651 |
652 def get(self, k, default=None): | 652 def get(self, k, default=None): |
653 try: | 653 try: |
654 return self._cache[k] | 654 return self._cache[k].value |
655 except KeyError: | 655 except KeyError: |
656 return default | 656 return default |
657 | 657 |
658 def clear(self): | 658 def clear(self): |
659 n = self._head | 659 n = self._head |