Mercurial > hg
changeset 3147:97420a49188d
add comments in cachefunc
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Fri, 22 Sep 2006 17:58:22 +0200 |
parents | e69a0cbe268e |
children | adb246ce6736 |
files | mercurial/util.py |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/util.py Fri Sep 22 08:19:25 2006 -0700 +++ b/mercurial/util.py Fri Sep 22 17:58:22 2006 +0200 @@ -26,8 +26,11 @@ def cachefunc(func): '''cache the result of function calls''' + # XXX doesn't handle keywords args cache = {} if func.func_code.co_argcount == 1: + # we gain a small amount of time because + # we don't need to pack/unpack the list def f(arg): if arg not in cache: cache[arg] = func(arg)