# HG changeset patch # User Benoit Boissinot # Date 1158940702 -7200 # Node ID 97420a49188d328b62308c69f892f468d7a6f8c2 # Parent e69a0cbe268ef51843ef2bf98e6db9390744db01 add comments in cachefunc diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -26,8 +26,11 @@ class SignalInterrupt(Exception): 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)