[PATCH 3 of 6] obsolete: populate successors(), precursors(), children() lazily
Matt Mackall
mpm at selenic.com
Thu Feb 5 00:06:23 UTC 2015
On Tue, 2015-02-03 at 20:01 -0800, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at google.com>
> # Date 1421822097 28800
> # Tue Jan 20 22:34:57 2015 -0800
> # Node ID cd65758885ab3cc6649001fa9aa68105d818323a
> # Parent 518d3caf2307a7699ec078afe9b1e6991640941c
> obsolete: populate successors(), precursors(), children() lazily
> def successors(self):
> + if self._successors is None:
> + self._successors = {}
> + self._addsuccessors(self._all)
> return self._successors
You probably want to look at how util.propertycache is used to make a
faster version of this pattern.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel
mailing list