equal
deleted
inserted
replaced
287 alen = a2 - a1 |
287 alen = a2 - a1 |
288 blen = b2 - b1 |
288 blen = b2 - b1 |
289 |
289 |
290 # find matches at the front |
290 # find matches at the front |
291 ii = 0 |
291 ii = 0 |
292 while ii < alen and ii < blen and \ |
292 while (ii < alen and ii < blen and |
293 self.a[a1 + ii] == self.b[b1 + ii]: |
293 self.a[a1 + ii] == self.b[b1 + ii]): |
294 ii += 1 |
294 ii += 1 |
295 startmatches = ii |
295 startmatches = ii |
296 |
296 |
297 # find matches at the end |
297 # find matches at the end |
298 ii = 0 |
298 ii = 0 |
299 while ii < alen and ii < blen and \ |
299 while (ii < alen and ii < blen and |
300 self.a[a2 - ii - 1] == self.b[b2 - ii - 1]: |
300 self.a[a2 - ii - 1] == self.b[b2 - ii - 1]): |
301 ii += 1 |
301 ii += 1 |
302 endmatches = ii |
302 endmatches = ii |
303 |
303 |
304 if startmatches > 0: |
304 if startmatches > 0: |
305 yield 'same', a1, a1 + startmatches |
305 yield 'same', a1, a1 + startmatches |
348 asub = amatch + (intbase - abase) |
348 asub = amatch + (intbase - abase) |
349 bsub = bmatch + (intbase - bbase) |
349 bsub = bmatch + (intbase - bbase) |
350 aend = asub + intlen |
350 aend = asub + intlen |
351 bend = bsub + intlen |
351 bend = bsub + intlen |
352 |
352 |
353 assert self.base[intbase:intend] == self.a[asub:aend], \ |
353 assert self.base[intbase:intend] == self.a[asub:aend], ( |
354 (self.base[intbase:intend], self.a[asub:aend]) |
354 (self.base[intbase:intend], self.a[asub:aend])) |
355 |
355 |
356 assert self.base[intbase:intend] == self.b[bsub:bend] |
356 assert self.base[intbase:intend] == self.b[bsub:bend] |
357 |
357 |
358 sl.append((intbase, intend, |
358 sl.append((intbase, intend, |
359 asub, aend, |
359 asub, aend, |