Submitter | phabricator |
---|---|
Date | Dec. 16, 2019, 6:32 a.m. |
Message ID | <9b3b3e0887176b0e83d5ec6c9843cc86@localhost.localdomain> |
Download | mbox | patch |
Permalink | /patch/43858/ |
State | Not Applicable |
Headers | show |
Comments
Patch
diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1195,12 +1195,12 @@ '''cache the result of function calls''' # XXX doesn't handle keywords args if func.__code__.co_argcount == 0: - cache = [] + listcache = [] def f(): - if len(cache) == 0: - cache.append(func()) - return cache[0] + if len(listcache) == 0: + listcache.append(func()) + return listcache[0] return f cache = {}