[PATCH] ancestors: prefetch method outside of the loop

Yuya Nishihara yuya at tcha.org
Sun Jun 21 01:15:33 CDT 2015


On Sat, 20 Jun 2015 15:29:15 -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at fb.com>
> # Date 1434766800 25200
> #      Fri Jun 19 19:20:00 2015 -0700
> # Node ID a005a978678ae5bbfdf4cf298af5449db5d7d369
> # Parent  2748bf78a5bf610da4f2d90fd1eea19a3b360c04
> ancestors: prefetch method outside of the loop
> 
> 15412bba5a68 is yet another example than this is worthwhile when it comes to
> performance, we blindly do in for all 'lazyancestors' method.
> 
> diff --git a/mercurial/ancestor.py b/mercurial/ancestor.py
> --- a/mercurial/ancestor.py
> +++ b/mercurial/ancestor.py
> @@ -310,19 +310,23 @@ class lazyancestors(object):
>          if self._inclusive:
>              for rev in revs:
>                  yield rev
>              seen.update(revs)
>  
> +

Nitpick, double empty lines.
It appears check-commit fails to catch this pattern.


More information about the Mercurial-devel mailing list