diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-10-05 09:00:03 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-10-11 22:21:10 +0000 |
commit | d4cbcdb37b505ecc2e8beaa141237e2830f0ef4e (patch) | |
tree | 2c58df4c59d22fcfa670be5ef8f518d14ef89452 | |
parent | cac771ad69087da58bacd008d3a3ae69c854b042 (diff) |
UpdateAxisActionJob: remove misleading redundant check
This code is in the then-branch of an if (buttonInput),
and buttonInput is not modified in between, so the
check for buttonInput here is redundant.
So remove it.
Also declare 'buttonInput' as const to have the above
analysis checked at compile-time, too.
Introduced in 496d8b53b16bd0703ab06978f18fcbbb7d95e845,
so Qt 5.6 is unaffected.
Coverity-Id: 161331
Change-Id: I86e4d81e534d7906281fc36b70dc57ccb56184ca
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r-- | src/input/backend/updateaxisactionjob.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/input/backend/updateaxisactionjob.cpp b/src/input/backend/updateaxisactionjob.cpp index 0cbd325c9..c7b771bdd 100644 --- a/src/input/backend/updateaxisactionjob.cpp +++ b/src/input/backend/updateaxisactionjob.cpp @@ -125,12 +125,11 @@ void UpdateAxisActionJob::updateAxis(LogicalDevice *device) continue; } - ButtonAxisInput *buttonInput = m_handler->buttonAxisInputManager()->lookupResource(axisInputId); - if (buttonInput) { + if (ButtonAxisInput * const buttonInput = m_handler->buttonAxisInputManager()->lookupResource(axisInputId)) { QAbstractPhysicalDeviceBackendNode *physicalDeviceBackend = findAxisInputPhysicalDevice(buttonInput); if (physicalDeviceBackend != nullptr) { // Update the value - const QVector<int> buttons = buttonInput ? buttonInput->buttons() : QVector<int>(); + const QVector<int> buttons = buttonInput->buttons(); if (!buttons.isEmpty()) { // TO DO: Linear Curver for the progression of the scale value if (anyOfRequiredButtonsPressed(buttons, physicalDeviceBackend)) |