forked from qt-creator/qt-creator
Avoid a few unnecessary non-const QString::operator[]() accesses
Change-Id: I44cbc418ce073da9b70df0e2d0851006140aaaf9 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -98,7 +98,7 @@ QList<FormattedText> AnsiEscapeCodeHandler::parseText(const FormattedText &input
|
||||
|
||||
while (!strippedText.isEmpty()) {
|
||||
QTC_ASSERT(m_pendingText.isEmpty(), break);
|
||||
const int escapePos = strippedText.indexOf(escape[0]);
|
||||
const int escapePos = strippedText.indexOf(escape.at(0));
|
||||
if (escapePos < 0) {
|
||||
outputData << FormattedText(strippedText, charFormat);
|
||||
break;
|
||||
@@ -106,9 +106,9 @@ QList<FormattedText> AnsiEscapeCodeHandler::parseText(const FormattedText &input
|
||||
outputData << FormattedText(strippedText.left(escapePos), charFormat);
|
||||
strippedText.remove(0, escapePos);
|
||||
}
|
||||
QTC_ASSERT(strippedText[0] == escape[0], break);
|
||||
QTC_ASSERT(strippedText.at(0) == escape.at(0), break);
|
||||
|
||||
while (!strippedText.isEmpty() && escape[0] == strippedText[0]) {
|
||||
while (!strippedText.isEmpty() && escape.at(0) == strippedText.at(0)) {
|
||||
if (escape.startsWith(strippedText)) {
|
||||
// control secquence is not complete
|
||||
m_pendingText += strippedText;
|
||||
|
||||
Reference in New Issue
Block a user