Mercurial > public > mercurial-scm > hg
diff mercurial/simplemerge.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 | 81c4e18c7cee |
children | 4cdaf1adafc8 |
line wrap: on
line diff
--- a/mercurial/simplemerge.py Thu Sep 23 10:59:21 2010 +0200 +++ b/mercurial/simplemerge.py Thu Sep 23 00:02:31 2010 -0500 @@ -110,7 +110,7 @@ if what == 'unchanged': for i in range(t[1], t[2]): yield self.base[i] - elif what == 'a' or what == 'same': + elif what in ('a', 'same'): for i in range(t[1], t[2]): yield self.a[i] elif what == 'b': @@ -142,7 +142,7 @@ if what == 'unchanged': for i in range(t[1], t[2]): yield 'u | ' + self.base[i] - elif what == 'a' or what == 'same': + elif what in ('a', 'same'): for i in range(t[1], t[2]): yield what[0] + ' | ' + self.a[i] elif what == 'b': @@ -181,7 +181,7 @@ what = t[0] if what == 'unchanged': yield what, self.base[t[1]:t[2]] - elif what == 'a' or what == 'same': + elif what in ('a', 'same'): yield what, self.a[t[1]:t[2]] elif what == 'b': yield what, self.b[t[1]:t[2]]