diff mercurial/revset.py @ 12387:4f8067c94729

cleanup: use x in (a, b) instead of x == a or x == b
author Brodie Rao <brodie@bitheap.org>
date Thu, 23 Sep 2010 00:02:31 -0500
parents b913232d13c1
children 4cdaf1adafc8
line wrap: on
line diff
--- a/mercurial/revset.py	Thu Sep 23 10:59:21 2010 +0200
+++ b/mercurial/revset.py	Thu Sep 23 00:02:31 2010 -0500
@@ -87,7 +87,7 @@
 # helpers
 
 def getstring(x, err):
-    if x and (x[0] == 'string' or x[0] == 'symbol'):
+    if x and x[0] in ('string', 'symbol'):
         return x[1]
     raise error.ParseError(err)
 
@@ -537,7 +537,7 @@
                          '-' + getstring(x[1], _("can't negate that"))), small)
     elif op in 'string symbol negate':
         return smallbonus, x # single revisions are small
-    elif op == 'and' or op == 'dagrange':
+    elif op in ('and', 'dagrange'):
         wa, ta = optimize(x[1], True)
         wb, tb = optimize(x[2], True)
         w = min(wa, wb)