diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-08-29 09:26:02 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-02 16:05:39 +0000 |
commit | e646ab2ab5491659f7aa028485b7502a06d4788d (patch) | |
tree | 8bb96a6e5264dbfe186e0eaeb6ffd8e8a34ff2bf /src/corelib/thread | |
parent | 101cb8e5d97f2f26ff0b3efd7b6e8b0e336e62be (diff) |
Windows code: Fix to prefer ranged-for, as clang-tidy advises
Change-Id: Id9bb21855ae832cdbbc456326226ec72b634672e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qwaitcondition_win.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/thread/qwaitcondition_win.cpp b/src/corelib/thread/qwaitcondition_win.cpp index 534456a935..a6ad95b397 100644 --- a/src/corelib/thread/qwaitcondition_win.cpp +++ b/src/corelib/thread/qwaitcondition_win.cpp @@ -223,8 +223,7 @@ void QWaitCondition::wakeOne() { // wake up the first waiting thread in the queue QMutexLocker locker(&d->mtx); - for (int i = 0; i < d->queue.size(); ++i) { - QWaitConditionEvent *current = d->queue.at(i); + for (QWaitConditionEvent *current : qAsConst(d->queue)) { if (current->wokenUp) continue; SetEvent(current->event); @@ -237,8 +236,7 @@ void QWaitCondition::wakeAll() { // wake up the all threads in the queue QMutexLocker locker(&d->mtx); - for (int i = 0; i < d->queue.size(); ++i) { - QWaitConditionEvent *current = d->queue.at(i); + for (QWaitConditionEvent *current : qAsConst(d->queue)) { SetEvent(current->event); current->wokenUp = true; } |