Permalink
Browse files

replaced line[0] with line.startswith()

issue #33
  • Loading branch information...
Aleksandr Gornostal
Aleksandr Gornostal committed Jan 16, 2013
1 parent cce37ff commit c11b17b5b6effb28ca59469d672e0178fbbfcba1
Showing with 4 additions and 4 deletions.
  1. +4 −4 Modific.py
View
@@ -315,11 +315,11 @@ def get_lines_to_hl(self):
current = chunk['start']
deleted_line = None
for line in chunk['lines']:
- if line[0] == '-':
+ if line.startswith('-'):
if (not deleted_line or deleted_line not in deleted):
deleted.append(current)
deleted_line = current
- elif line[0] == '+':
+ elif line.startswith('+'):
if deleted_line:
deleted.pop()
deleted_line = None
@@ -350,11 +350,11 @@ def get_original_part(self, line_num):
replace_lines = 0
return_this_lines = False
for line in chunk['lines']:
- if line[0] == '-' or line[0] == '+':
+ if line.startswith('-') or line.startswith('+'):
first = first or current
if current == line_num:
return_this_lines = True
- if line[0] == '-':
+ if line.startswith('-'):
ret_lines.append(line[1:])
else:
replace_lines += 1

0 comments on commit c11b17b

Please sign in to comment.