mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Fix-up a comment
This commit is contained in:
parent
7f7a5a7b87
commit
c6897854f8
1 changed files with 2 additions and 3 deletions
|
|
@ -172,7 +172,7 @@ def lru_cache(maxsize=100, typed=False):
|
||||||
cache = {}
|
cache = {}
|
||||||
hits = misses = 0
|
hits = misses = 0
|
||||||
kwd_mark = (object(),) # separate positional and keyword args
|
kwd_mark = (object(),) # separate positional and keyword args
|
||||||
cache_get = cache.get # bound method to lookup key or return None
|
cache_get = cache.get # bound method to lookup a key or return None
|
||||||
sentinel = object() # unique object used with cache_get
|
sentinel = object() # unique object used with cache_get
|
||||||
_len = len # localize the global len() function
|
_len = len # localize the global len() function
|
||||||
lock = Lock() # because linkedlist updates aren't threadsafe
|
lock = Lock() # because linkedlist updates aren't threadsafe
|
||||||
|
|
@ -250,8 +250,7 @@ def lru_cache(maxsize=100, typed=False):
|
||||||
# empty the oldest link and make it the new root
|
# empty the oldest link and make it the new root
|
||||||
root = root[NEXT]
|
root = root[NEXT]
|
||||||
del cache[root[KEY]]
|
del cache[root[KEY]]
|
||||||
root[KEY] = None
|
root[KEY] = root[RESULT] = None
|
||||||
root[RESULT] = None
|
|
||||||
misses += 1
|
misses += 1
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue