Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
move a line; add some comments
  • Loading branch information
tim-one committed May 24, 2024
commit 1a0426d06bca312f7793b9f6d34cbf61d97d9d91
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