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:
@@ -231,8 +231,8 @@ QString previousRevision(const QString &rev)
|
||||
const int dotPos = rev.lastIndexOf(QLatin1Char('.'));
|
||||
if (dotPos == -1)
|
||||
return rev;
|
||||
const int minor = rev.mid(dotPos + 1).toInt();
|
||||
return rev.left(dotPos + 1) + QString::number(minor - 1);
|
||||
const int minor = rev.midRef(dotPos + 1).toInt();
|
||||
return rev.leftRef(dotPos + 1) + QString::number(minor - 1);
|
||||
}
|
||||
|
||||
// Is "[1.2...].1"?
|
||||
|
||||
Reference in New Issue
Block a user