Browse Source

Limited the time that TextDiff can spend on large input files.

tags/2021-05-28
jules 12 years ago
parent
commit
229beeab83
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      modules/juce_core/text/juce_TextDiff.cpp

+ 5
- 0
modules/juce_core/text/juce_TextDiff.cpp View File

@@ -116,6 +116,7 @@ struct TextDiffHelpers
int* l0 = lines;
int* l1 = l0 + lenB + 1;
int loopsWithoutImprovement = 0;
int bestLength = 0;
indexInA = indexInB = 0;
@@ -137,6 +138,7 @@ struct TextDiffHelpers
if (len > bestLength)
{
loopsWithoutImprovement = 0;
bestLength = len;
indexInA = i;
indexInB = j;
@@ -144,6 +146,9 @@ struct TextDiffHelpers
}
}
if (++loopsWithoutImprovement > 100)
break;
std::swap (l0, l1);
}


Loading…
Cancel
Save