Use QStringRef instead of QString whenever possible.
That way we reduce count of temporary QString instances. Change-Id: Id806c68ea616828c2355c07b8576616fa6a8da17 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
This commit is contained in:
committed by
The Qt Project
parent
15025088ea
commit
e485e066ac
@@ -92,7 +92,7 @@ QString BbMediaStorageLocation::generateFileName(const QString &prefix, const QD
|
||||
if (lastMediaIndex == 0) {
|
||||
// first run, find the maximum media number during the fist capture
|
||||
Q_FOREACH (const QString &fileName, dir.entryList(QStringList() << QString("%1*.%2").arg(prefix).arg(extension))) {
|
||||
const qint64 mediaIndex = fileName.mid(prefix.length(), fileName.size() - prefix.length() - extension.length() - 1).toInt();
|
||||
const qint64 mediaIndex = fileName.midRef(prefix.length(), fileName.size() - prefix.length() - extension.length() - 1).toInt();
|
||||
lastMediaIndex = qMax(lastMediaIndex, mediaIndex);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user