Commit 20898478 authored by Vincent Legoll's avatar Vincent Legoll

Inline lambda as it obfuscates the code, use variable before its definition, etc...

svn path=/trunk/; revision=1162
parent 8c79440e
......@@ -105,11 +105,10 @@ class Differ(object):
def _locate_chunk(self, whichdiffs, sequence, line):
"""Find the index of the chunk which contains line."""
idx = 1 + 2*(sequence != 1)
line_in_chunk = lambda x: line < c[idx+1]
idx = 1 + 2 * (sequence != 1)
i = 0
for c in self.diffs[whichdiffs]:
if line_in_chunk(c):
if line < c[idx + 1]: # Is line in chunk ?
break
else:
i += 1
......
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