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/global/qlibraryinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index c31b6daa00..4303f74709 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -532,7 +532,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) reg_var.setMinimal(true); while((rep = reg_var.indexIn(ret)) != -1) { ret.replace(rep, reg_var.matchedLength(), - QString::fromLocal8Bit(qgetenv(ret.mid(rep + 2, + QString::fromLocal8Bit(qgetenv(ret.midRef(rep + 2, reg_var.matchedLength() - 3).toLatin1().constData()).constData())); } -- cgit v1.2.3