# HG changeset patch # User Jun Wu <qu...@fb.com> # Date 1494458278 25200 # Wed May 10 16:17:58 2017 -0700 # Node ID ffac07761a9b7e5277948c5a6572de125b23d296 # Parent a5a22d616f981e8c220f1c2fd4eae098e104a11c # Available At https://bitbucket.org/quark-zju/hg-draft # hg pull https://bitbucket.org/quark-zju/hg-draft -r ffac07761a9b flagprocessor: add a fast path when flags is 0
When flags is 0, _processflags could be a no-op instead of iterating through the flag bits. diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1353,4 +1353,7 @@ class revlog(object): operation and will only update the value of ``validatehash``. """ + # fast path: no flag processors will run + if flags == 0: + return text, True if not operation in ('read', 'write'): raise ProgrammingError(_("invalid '%s' operation ") % (operation)) _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel