Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Lib/difflib.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,10 +942,12 @@ def _fancy_replace(self, a, alo, ahi, b, blo, bhi):
cruncher.set_seq1(a[i])
# Ordering by cheapest to most expensive ratio is very
# valuable, most often getting out early.
if (crqr() > best_ratio
and cqr() > best_ratio
and cr() > best_ratio):
best_i, best_j, best_ratio = i, j, cr()
if crqr() <= best_ratio or cqr() <= best_ratio:
continue

ratio = cr()
if ratio > best_ratio:
best_i, best_j, best_ratio = i, j, ratio

if best_i is None:
# found nothing to synch on yet - move to next j
Expand Down
Loading