diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-10-10 23:40:58 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-10-12 09:34:03 +0000 |
commit | 690f9a7e74701e64db1035ccb11673942988d927 (patch) | |
tree | 031ecd5570f9b8e3051bb11531c2511167c861cc /src/corelib/io/qfilesystemwatcher.cpp | |
parent | 2a1ea8f13be95f664b112663986102300a17bdfe (diff) |
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) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/io/qfilesystemwatcher.cpp')
-rw-r--r-- | src/corelib/io/qfilesystemwatcher.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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(); |