forked from qt-creator/qt-creator
Don't use static variables in differ
Now the differ may run in parallel in many threads. Static variables may lead to crash. Change-Id: Iae0d7678cdca3e57cb619141081250b458852bfb Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -202,9 +202,9 @@ static QList<Diff> cleanupOverlaps(const QList<Diff> &diffList)
|
||||
|
||||
static int cleanupSemanticsScore(const QString &text1, const QString &text2)
|
||||
{
|
||||
static QRegExp blankLineEnd = QRegExp(QLatin1String("\\n\\r?\\n$"));
|
||||
static QRegExp blankLineStart = QRegExp(QLatin1String("^\\r?\\n\\r?\\n"));
|
||||
static QRegExp sentenceEnd = QRegExp(QLatin1String("\\. $"));
|
||||
const QRegExp blankLineEnd = QRegExp(QLatin1String("\\n\\r?\\n$"));
|
||||
const QRegExp blankLineStart = QRegExp(QLatin1String("^\\r?\\n\\r?\\n"));
|
||||
const QRegExp sentenceEnd = QRegExp(QLatin1String("\\. $"));
|
||||
|
||||
if (!text1.count() || !text2.count()) // Edges
|
||||
return 6;
|
||||
|
||||
Reference in New Issue
Block a user