RCCFileInfo: use QString prepend optimization

Instead of using QStringBuilder (which always allocates a new QString to
hold the result of the concatenation), reuse the existing QString, and
use prepend which will typically have allocated extra space, reducing
the chances it will reallocate.

Change-Id: Ic4ef775246db58e56152a6ede1a75f7621950dd9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Ahmad Samir 2022-12-17 11:43:14 +02:00 committed by Marc Mutz
parent ff83fc7590
commit 348911a4e7

View File

@ -142,7 +142,8 @@ QString RCCFileInfo::resourceName() const
QString resource = m_name;
for (RCCFileInfo *p = m_parent; p; p = p->m_parent)
resource = resource.prepend(p->m_name + u'/');
return u':' + resource;
resource.prepend(u':');
return resource;
}
void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)