Mercurial > public > mercurial-scm > hg
comparison mercurial/simplemerge.py @ 38783:e7aa113b14f7
global: use pycompat.xrange()
On Python 3, our module importer automatically rewrites xrange()
to pycompat.xrange().
We want to move away from the custom importer on Python 3.
This commit converts all instances of xrange() to use
pycompat.xrange().
Differential Revision: https://phab.mercurial-scm.org/D4032
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 01 Aug 2018 13:00:45 -0700 |
parents | f0b6fbea00cf |
children | aaad36b88298 |
comparison
equal
deleted
inserted
replaced
38782:7eba8f83129b | 38783:e7aa113b14f7 |
---|---|
56 def compare_range(a, astart, aend, b, bstart, bend): | 56 def compare_range(a, astart, aend, b, bstart, bend): |
57 """Compare a[astart:aend] == b[bstart:bend], without slicing. | 57 """Compare a[astart:aend] == b[bstart:bend], without slicing. |
58 """ | 58 """ |
59 if (aend - astart) != (bend - bstart): | 59 if (aend - astart) != (bend - bstart): |
60 return False | 60 return False |
61 for ia, ib in zip(xrange(astart, aend), xrange(bstart, bend)): | 61 for ia, ib in zip(pycompat.xrange(astart, aend), |
62 pycompat.xrange(bstart, bend)): | |
62 if a[ia] != b[ib]: | 63 if a[ia] != b[ib]: |
63 return False | 64 return False |
64 else: | 65 else: |
65 return True | 66 return True |
66 | 67 |