diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-03-31 12:01:59 +0300 |
---|---|---|
committer | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-07-02 07:39:06 +0000 |
commit | 6662919ecde901771d9641fd732aa0735ebb39e6 (patch) | |
tree | 449752f7d9582cd685d81829e0e2245b0f9a0ece /src/corelib/io/qstandardpaths_unix.cpp | |
parent | 2185b2f054ddae0fc67b8799b3561c57729f1cd7 (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/qstandardpaths_unix.cpp')
-rw-r--r-- | src/corelib/io/qstandardpaths_unix.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp index bcbc9664ef..0561e5833f 100644 --- a/src/corelib/io/qstandardpaths_unix.cpp +++ b/src/corelib/io/qstandardpaths_unix.cpp @@ -223,7 +223,7 @@ QString QStandardPaths::writableLocation(StandardLocation type) if (!value.isEmpty()) { // value can start with $HOME if (value.startsWith(QLatin1String("$HOME"))) - value = QDir::homePath() + value.mid(5); + value = QDir::homePath() + value.midRef(5); if (value.length() > 1 && value.endsWith(QLatin1Char('/'))) value.chop(1); return value; |