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

@@ -587,8 +587,8 @@ void MmRendererMediaPlayerControl::setMmBufferStatus(const QString &bufferStatus
{
const int slashPos = bufferStatus.indexOf('/');
if (slashPos != -1) {
const int fill = bufferStatus.left(slashPos).toInt();
const int capacity = bufferStatus.mid(slashPos + 1).toInt();
const int fill = bufferStatus.leftRef(slashPos).toInt();
const int capacity = bufferStatus.midRef(slashPos + 1).toInt();
if (capacity != 0) {
m_bufferStatus = fill / static_cast<float>(capacity) * 100.0f;
emit bufferStatusChanged(m_bufferStatus);