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/qfilesystemiterator_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/io/qfilesystemiterator_win.cpp') diff --git a/src/corelib/io/qfilesystemiterator_win.cpp b/src/corelib/io/qfilesystemiterator_win.cpp index 9e40a41b4c..2ce7bd7a4b 100644 --- a/src/corelib/io/qfilesystemiterator_win.cpp +++ b/src/corelib/io/qfilesystemiterator_win.cpp @@ -40,6 +40,7 @@ #include "qfilesystemiterator_p.h" #include "qfilesystemengine_p.h" #include "qplatformdefs.h" +#include "qvector.h" #include @@ -103,7 +104,7 @@ bool QFileSystemIterator::advance(QFileSystemEntry &fileEntry, QFileSystemMetaDa FINDEX_SEARCH_OPS(searchOps), 0, dwAdditionalFlags); if (findFileHandle == INVALID_HANDLE_VALUE) { if (nativePath.startsWith(QLatin1String("\\\\?\\UNC\\"))) { - QStringList parts = nativePath.split(QLatin1Char('\\'), QString::SkipEmptyParts); + const QVector parts = nativePath.splitRef(QLatin1Char('\\'), QString::SkipEmptyParts); if (parts.count() == 4 && QFileSystemEngine::uncListSharesOnServer( QLatin1String("\\\\") + parts.at(2), &uncShares)) { if (uncShares.isEmpty()) -- cgit v1.2.3