summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qresource.cpp
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-03-31 12:01:59 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-07-02 07:39:06 +0000
commit6662919ecde901771d9641fd732aa0735ebb39e6 (patch)
tree449752f7d9582cd685d81829e0e2245b0f9a0ece /src/corelib/io/qresource.cpp
parent2185b2f054ddae0fc67b8799b3561c57729f1cd7 (diff)
CoreLib: use QStringRef to optimize memory allocation
Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. Change-Id: Id9ea11b16947220cd27787c0b529de62d10b6c26 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/io/qresource.cpp')
-rw-r--r--src/corelib/io/qresource.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 96957ac11d..7fe3753da4 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -303,12 +303,12 @@ QResourcePrivate::ensureInitialized() const
if(!that->absoluteFilePath.startsWith(QLatin1Char(':')))
that->absoluteFilePath.prepend(QLatin1Char(':'));
- QString path = fileName;
+ QStringRef path(&fileName);
if(path.startsWith(QLatin1Char(':')))
path = path.mid(1);
if(path.startsWith(QLatin1Char('/'))) {
- that->load(path);
+ that->load(path.toString());
} else {
QMutexLocker lock(resourceMutex());
QStringList searchPaths = *resourceSearchPaths();