forked from qt-creator/qt-creator
SyntaxHighlighter: Remove useless code branch
Change-Id: I20ea87cf43bae9540707c1e765e40e4baee93357 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -125,7 +125,6 @@ void SyntaxHighlighterPrivate::applyFormatChanges(int from, int charsRemoved, in
|
|||||||
QTextCharFormat emptyFormat;
|
QTextCharFormat emptyFormat;
|
||||||
|
|
||||||
QTextLayout::FormatRange r;
|
QTextLayout::FormatRange r;
|
||||||
r.start = -1;
|
|
||||||
|
|
||||||
QVector<QTextLayout::FormatRange> new_ranges;
|
QVector<QTextLayout::FormatRange> new_ranges;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -143,18 +142,8 @@ void SyntaxHighlighterPrivate::applyFormatChanges(int from, int charsRemoved, in
|
|||||||
while (i < formatChanges.count() && formatChanges.at(i) == r.format)
|
while (i < formatChanges.count() && formatChanges.at(i) == r.format)
|
||||||
++i;
|
++i;
|
||||||
|
|
||||||
if (i >= formatChanges.count())
|
|
||||||
break;
|
|
||||||
|
|
||||||
r.length = i - r.start;
|
r.length = i - r.start;
|
||||||
|
|
||||||
new_ranges << r;
|
|
||||||
r.start = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (r.start != -1) {
|
|
||||||
r.length = formatChanges.count() - r.start;
|
|
||||||
|
|
||||||
new_ranges << r;
|
new_ranges << r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user