[PATCH 2 of 4] revset: remove useless code to reorder weights of 'or' expression

Yuya Nishihara yuya at tcha.org
Tue May 26 10:00:20 CDT 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1430040452 -32400
#      Sun Apr 26 18:27:32 2015 +0900
# Node ID 70591283d99dcc442f0e7bdb9afa603eb18bfac1
# Parent  3c41bb6a51f96c0e4409f6b21689f61c16e149b2
revset: remove useless code to reorder weights of 'or' expression

Perhaps there was copy-paste error.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2162,8 +2162,6 @@ def optimize(x, small):
     elif op == 'or':
         wa, ta = optimize(x[1], False)
         wb, tb = optimize(x[2], False)
-        if wb < wa:
-            wb, wa = wa, wb
         return max(wa, wb), (op, ta, tb)
     elif op == 'not':
         # Optimize not public() to _notpublic() because we have a fast version


More information about the Mercurial-devel mailing list