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:
Jędrzej Nowacki
2014-01-15 16:56:12 +01:00
committed by The Qt Project
parent 15025088ea
commit e485e066ac
11 changed files with 23 additions and 23 deletions

View File

@@ -508,7 +508,7 @@ QString CameraBinSession::generateFileName(const QString &prefix, const QDir &di
{
int lastClip = 0;
foreach(QString fileName, dir.entryList(QStringList() << QString("%1*.%2").arg(prefix).arg(ext))) {
int imgNumber = fileName.mid(prefix.length(), fileName.size()-prefix.length()-ext.length()-1).toInt();
int imgNumber = fileName.midRef(prefix.length(), fileName.size()-prefix.length()-ext.length()-1).toInt();
lastClip = qMax(lastClip, imgNumber);
}