Commit 70602e65 authored by Michal Čihař's avatar Michal Čihař

Use range instead of xrange

We're handling small ranges here, so the difference is not reasonable
and this way we're compatible with Python 3.
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 4a70f335
...@@ -36,11 +36,11 @@ def highlight_string(source, unit): ...@@ -36,11 +36,11 @@ def highlight_string(source, unit):
highlights.sort(key=lambda x: x[0]) highlights.sort(key=lambda x: x[0])
# Remove overlapping ones # Remove overlapping ones
for hl_idx in xrange(0, len(highlights)): for hl_idx in range(0, len(highlights)):
if hl_idx >= len(highlights): if hl_idx >= len(highlights):
break break
elref = highlights[hl_idx] elref = highlights[hl_idx]
for hl_idx_next in xrange(hl_idx + 1, len(highlights)): for hl_idx_next in range(hl_idx + 1, len(highlights)):
if hl_idx_next >= len(highlights): if hl_idx_next >= len(highlights):
break break
eltest = highlights[hl_idx_next] eltest = highlights[hl_idx_next]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment