From 6662919ecde901771d9641fd732aa0735ebb39e6 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Thu, 31 Mar 2016 12:01:59 +0300 Subject: 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 --- src/corelib/io/qstandardpaths_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/io/qstandardpaths_unix.cpp') 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; -- cgit v1.2.3