We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93cd2c3 commit c89507aCopy full SHA for c89507a
lib/fdiff/thirdparty/fdifflib.py
@@ -325,8 +325,19 @@ def __chain_b(self):
325
# Purge popular elements that are not junk
326
self.bpopular = popular = set()
327
n = len(b)
328
- if self.autojunk and n >= 200:
+
329
+ # Define the number of identical lines that must be included
330
+ # in order to consider the string "popular" for the autojunk
331
+ # strategy. Edited from upstream Python difflib to decrease
332
+ # the number of lines as file sizes become larger
333
+ if n >= 20000:
334
+ ntest = n // 10000 + 1
335
+ elif n >= 2000:
336
+ ntest = n // 1000 + 1
337
+ elif n >= 200:
338
ntest = n // 100 + 1
339
340
+ if self.autojunk and n >= 200:
341
for elt, idxs in b2j.items():
342
if len(idxs) > ntest:
343
popular.add(elt)
0 commit comments