Fossil SCM
Fix the longestCommonSequence() routine so that it works even with very large negative scores that can result from files with hundreds of thousands of lines of text. [forum/forumpost/27e77558ad21ffed|forum thread 27e77558ad21ffed].
Commit
f214aba4f5c4846de0e15cc81f70e574babc040c36389a5e95711cb875045bf3
Parent
48d7f4370f967ab…
1 file changed
+1
-1
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -2462,11 +2462,11 @@ | ||
| 2462 | 2462 | int span; /* combined width of the input sequences */ |
| 2463 | 2463 | int cutoff = 4; /* Max hash chain entries to follow */ |
| 2464 | 2464 | int nextCutoff = -1; /* Value of cutoff for next iteration */ |
| 2465 | 2465 | |
| 2466 | 2466 | span = (iE1 - iS1) + (iE2 - iS2); |
| 2467 | - bestScore = -10000; | |
| 2467 | + bestScore = -9223300000*(sqlite3_int64)1000000000; | |
| 2468 | 2468 | score = 0; |
| 2469 | 2469 | iSXb = iSXp = iS1; |
| 2470 | 2470 | iEXb = iEXp = iS1; |
| 2471 | 2471 | iSYb = iSYp = iS2; |
| 2472 | 2472 | iEYb = iEYp = iS2; |
| 2473 | 2473 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2462,11 +2462,11 @@ | |
| 2462 | int span; /* combined width of the input sequences */ |
| 2463 | int cutoff = 4; /* Max hash chain entries to follow */ |
| 2464 | int nextCutoff = -1; /* Value of cutoff for next iteration */ |
| 2465 | |
| 2466 | span = (iE1 - iS1) + (iE2 - iS2); |
| 2467 | bestScore = -10000; |
| 2468 | score = 0; |
| 2469 | iSXb = iSXp = iS1; |
| 2470 | iEXb = iEXp = iS1; |
| 2471 | iSYb = iSYp = iS2; |
| 2472 | iEYb = iEYp = iS2; |
| 2473 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2462,11 +2462,11 @@ | |
| 2462 | int span; /* combined width of the input sequences */ |
| 2463 | int cutoff = 4; /* Max hash chain entries to follow */ |
| 2464 | int nextCutoff = -1; /* Value of cutoff for next iteration */ |
| 2465 | |
| 2466 | span = (iE1 - iS1) + (iE2 - iS2); |
| 2467 | bestScore = -9223300000*(sqlite3_int64)1000000000; |
| 2468 | score = 0; |
| 2469 | iSXb = iSXp = iS1; |
| 2470 | iEXb = iEXp = iS1; |
| 2471 | iSYb = iSYp = iS2; |
| 2472 | iEYb = iEYp = iS2; |
| 2473 |