Skip to content
Snippets Groups Projects
Commit e40b7a50 authored by Augie Fackler's avatar Augie Fackler
Browse files

fastannotate: slice strings to get single character

Behaves identically on Python 3 and Python 2.

Differential Revision: https://phab.mercurial-scm.org/D5612
parent 1198c86b
Branches
Tags
No related merge requests found
......@@ -103,7 +103,7 @@
result += ': ' + self.ui.label('-' + lines[i],
'diff.deleted')
if result[-1] != '\n':
if result[-1:] != '\n':
result += '\n'
self.ui.write(result)
......
......@@ -98,7 +98,7 @@
state = 0 # 0: vfspath, 1: size
vfspath = size = ''
while i < l:
ch = payload[i]
ch = payload[i:i + 1]
if ch == '\0':
if state == 1:
result[vfspath] = buffer(payload, i + 1, int(size))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment