forked from qt-creator/qt-creator
Preferably use QStringRef::toInt().
Avoid allocations for converting to int. Change-Id: Id8c79334f4809ec075ffe7e6b7635be4873eafd8 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -48,7 +48,7 @@ static QString decode(const QString& original)
|
||||
while ((pos = regex.indexIn(original, pos)) != -1) {
|
||||
const QString value = regex.cap(1);
|
||||
if (value.startsWith(QLatin1Char('x')))
|
||||
result.replace(regex.cap(0), QChar(value.mid(1).toInt(0, 16)));
|
||||
result.replace(regex.cap(0), QChar(value.midRef(1).toInt(0, 16)));
|
||||
else
|
||||
result.replace(regex.cap(0), QChar(value.toInt(0, 10)));
|
||||
pos += regex.matchedLength();
|
||||
|
||||
Reference in New Issue
Block a user