File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed
Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " diff2html" ,
3- "version" : " 2.0.0-beta9 " ,
3+ "version" : " 2.0.0-beta10 " ,
44 "homepage" : " http://rtfpessoa.github.io/diff2html/" ,
55 "description" : " Fast Diff to colorized HTML" ,
66 "keywords" : [
Original file line number Diff line number Diff line change 21992199 var insertType ;
22002200 var deleteType ;
22012201
2202- var doMatching = that . config . matching === 'lines' || that . config . matching === 'words' ;
2202+ var comparisons = oldLines . length * newLines . length ;
2203+ var maxComparisons = that . config . matchingMaxComparisons || 2500 ;
2204+ var doMatching = comparisons < maxComparisons && ( that . config . matching === 'lines' ||
2205+ that . config . matching === 'words' ) ;
22032206
22042207 if ( doMatching ) {
22052208 matches = matcher ( oldLines , newLines ) ;
54115414 var matches ;
54125415 var insertType ;
54135416 var deleteType ;
5414- var doMatching = that . config . matching === 'lines' || that . config . matching === 'words' ;
5417+
5418+ var comparisons = oldLines . length * newLines . length ;
5419+ var maxComparisons = that . config . matchingMaxComparisons || 2500 ;
5420+ var doMatching = comparisons < maxComparisons && ( that . config . matching === 'lines' ||
5421+ that . config . matching === 'words' ) ;
54155422
54165423 if ( doMatching ) {
54175424 matches = matcher ( oldLines , newLines ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " diff2html" ,
3- "version" : " 2.0.0-beta9 " ,
3+ "version" : " 2.0.0-beta10 " ,
44 "homepage" : " http://rtfpessoa.github.io/diff2html/" ,
55 "description" : " Fast Diff to colorized HTML" ,
66 "keywords" : [
You can’t perform that action at this time.
0 commit comments