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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user