From 690f9a7e74701e64db1035ccb11673942988d927 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 10 Oct 2015 23:40:58 +0200 Subject: QtCore: use QStringRef in more places Apart from removing some unwanted allocations, also reduces text size by ~800B on Linux AMD64 GCC 4.9 release builds. Change-Id: Ibcd1d8264f54f2b165b69bee8aa50ff7f4ad3a10 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/io/qfilesystemwatcher.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/corelib/io/qfilesystemwatcher.cpp') diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp index 7fc3049f46..23a2fbecdb 100644 --- a/src/corelib/io/qfilesystemwatcher.cpp +++ b/src/corelib/io/qfilesystemwatcher.cpp @@ -296,7 +296,9 @@ QStringList QFileSystemWatcher::addPaths(const QStringList &paths) QFileSystemWatcherEngine *engine = 0; - if(!objectName().startsWith(QLatin1String("_qt_autotest_force_engine_"))) { + const QString on = objectName(); + + if (!on.startsWith(QLatin1String("_qt_autotest_force_engine_"))) { // Normal runtime case - search intelligently for best engine if(d->native) { engine = d->native; @@ -307,7 +309,7 @@ QStringList QFileSystemWatcher::addPaths(const QStringList &paths) } else { // Autotest override case - use the explicitly selected engine only - QString forceName = objectName().mid(26); + const QStringRef forceName = on.midRef(26); if(forceName == QLatin1String("poller")) { qDebug() << "QFileSystemWatcher: skipping native engine, using only polling engine"; d_func()->initPollerEngine(); -- cgit v1.2.3