[PATCH stable] revset: don't cache abstractsmartset min/max invocations infinitely

Mads Kiilerich mads at kiilerich.com
Wed Oct 26 09:13:57 EDT 2016


On 10/26/2016 02:31 PM, Yuya Nishihara wrote:
> On Wed, 26 Oct 2016 14:09:17 +0200, Mads Kiilerich wrote:
>> Instead, I would perhaps prefer to introduce a 'gettercache' that works
>> on methods that only have self as parameter (and thus can set a simple
>> instance method as I do here)  ... or a 'methodcache' that would be like
>> cachefunc but store the cache on the first 'self' parameter.
> That also seems fine. (I'm not a big fan of overwriting methods since we're
> likely to create self->self cycle, but that wouldn't be the case here.)


I guess it could be slightly more gc efficient to use 'lambda v=v: v' to 
avoid having a reference to v in the outer scope that also has self ...

/Mads



More information about the Mercurial-devel mailing list