Skip to content

Commit

Permalink
move a line; add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-one committed May 24, 2024
1 parent 8e93248 commit 1a0426d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Lib/difflib.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,11 +918,11 @@ def _fancy_replace(self, a, alo, ahi, b, blo, bhi):
# entirely.
cutoff = 0.74999
cruncher = SequenceMatcher(self.charjunk)

WINDOW = 10
crqr = cruncher.real_quick_ratio
cqr = cruncher.quick_ratio
cr = cruncher.ratio

WINDOW = 10
dump_i, dump_j = alo, blo
start_i, start_j = alo, blo
while start_i < ahi and start_j < bhi:
Expand Down Expand Up @@ -960,6 +960,7 @@ def _fancy_replace(self, a, alo, ahi, b, blo, bhi):
start_j += WINDOW
continue

# pump out straight replace from before this synch pair
yield from self._fancy_helper(a, dump_i, best_i,
b, dump_j, best_j)
start_i, start_j = best_i + 1, best_j + 1
Expand Down Expand Up @@ -989,7 +990,7 @@ def _fancy_replace(self, a, alo, ahi, b, blo, bhi):
# the synch pair is identical
yield ' ' + aelt

# pump out diffs from after the last synch point
# pump out straight replace from after the last synch pair
yield from self._fancy_helper(a, dump_i, ahi,
b, dump_j, bhi)

Expand Down

0 comments on commit 1a0426d

Please sign in to comment.