diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2018-08-01 23:09:25 +0300 |
---|---|---|
committer | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2018-08-06 08:20:56 +0000 |
commit | 4a51fccfc24f693e20ef82c0e2cc925d7b5ea5d0 (patch) | |
tree | ff91e3c0b3e93835963f76c1c250c9bc51b911a1 | |
parent | e7e8267fd52f1c04fd6342307cb944bb92006542 (diff) |
plugins/t9write: Fix operator precedence
Fix compiler warning:
operator '?:' has lower precedence than '+'; '+' will be evaluated first
This bug caused the function to return either 1 or 0 when the expected
return value was the number of tasks. However, the bug did not affect the
functionality since the return value was always compared to zero. Now
the function returns the expected result.
Change-Id: Id3c68029542c6494928ceb313ea5d41a3676829b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/plugins/t9write/plugin/t9writeworker.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/t9write/plugin/t9writeworker.cpp b/src/plugins/t9write/plugin/t9writeworker.cpp index 30cedc01..a18ae6ea 100644 --- a/src/plugins/t9write/plugin/t9writeworker.cpp +++ b/src/plugins/t9write/plugin/t9writeworker.cpp @@ -372,7 +372,7 @@ void T9WriteWorker::waitForAllTasks() int T9WriteWorker::numberOfPendingTasks() { QMutexLocker guard(&taskLock); - return taskList.count() + !idleSema.available() ? 1 : 0; + return taskList.count() + (!idleSema.available() ? 1 : 0); } void T9WriteWorker::run() |