diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-12-23 00:15:30 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-01-04 12:22:55 +0000 |
commit | 194e158beb73be8d5cf879086dc3a002ff4c8809 (patch) | |
tree | c206019dbd7dc6e2c0eff636ae0bb962d3ccd4a0 /src/corelib/io/qfilesystemwatcher_win.cpp | |
parent | 5170c0416bc598414d026f35774c617173ce6ece (diff) |
QtCore: eradicate all Q_FOREACH loops [io]
Saves more than 1KiB in text size on optimized GCC 4.9 Linux
AMD64 builds.
Change-Id: I1a974e903bc8352af800fa26edae0194c1e51705
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qfilesystemwatcher_win.cpp')
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_win.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp index 2e01e1a857..6c263b6847 100644 --- a/src/corelib/io/qfilesystemwatcher_win.cpp +++ b/src/corelib/io/qfilesystemwatcher_win.cpp @@ -164,7 +164,7 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths, // now look for a thread to insert bool found = false; - foreach(QWindowsFileSystemWatcherEngineThread *thread, threads) { + for (QWindowsFileSystemWatcherEngineThread *thread : qAsConst(threads)) { QMutexLocker(&(thread->mutex)); if (thread->handles.count() < MAXIMUM_WAIT_OBJECTS) { DEBUG() << "Added handle" << handle.handle << "for" << absolutePath << "to watch" << fileInfo.absoluteFilePath() @@ -311,7 +311,7 @@ QWindowsFileSystemWatcherEngineThread::~QWindowsFileSystemWatcherEngineThread() CloseHandle(handles.at(0)); handles[0] = INVALID_HANDLE_VALUE; - foreach (HANDLE h, handles) { + for (HANDLE h : qAsConst(handles)) { if (h == INVALID_HANDLE_VALUE) continue; FindCloseChangeNotification(h); @@ -323,7 +323,7 @@ static inline QString msgFindNextFailed(const QWindowsFileSystemWatcherEngineThr QString result; QTextStream str(&result); str << "QFileSystemWatcher: FindNextChangeNotification failed for"; - foreach (const QWindowsFileSystemWatcherEngine::PathInfo &pathInfo, pathInfos) + for (const QWindowsFileSystemWatcherEngine::PathInfo &pathInfo : pathInfos) str << " \"" << QDir::toNativeSeparators(pathInfo.absolutePath) << '"'; str << ' '; return result; |