From fc9d0a76f47e97f2bdd35edc24695c95654a2a67 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 3 Dec 2015 22:32:44 +0100 Subject: api/joy: there's no joy_handle == nullptr case, don't check for it --- opentrack/win32-joystick.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'opentrack') diff --git a/opentrack/win32-joystick.cpp b/opentrack/win32-joystick.cpp index cd3502b4..1c658c75 100644 --- a/opentrack/win32-joystick.cpp +++ b/opentrack/win32-joystick.cpp @@ -51,7 +51,7 @@ bool win32_joy_ctx::poll_axis(const QString &guid, int axes[]) auto iter = joys().find(guid); - if (iter == joys().end() || iter->second->joy_handle == nullptr) + if (iter == joys().end()) return false; auto& j = iter->second; @@ -172,9 +172,6 @@ bool win32_joy_ctx::joy::poll(fn f) HRESULT hr; bool ok = false; - if (joy_handle == nullptr) - return false; - (void) joy_handle->Acquire(); if (!FAILED(joy_handle->Poll())) @@ -252,7 +249,7 @@ win32_joy_ctx::enum_state::EnumJoysticksCallback(const DIDEVICEINSTANCE *pdidIns const QString name = QString(pdidInstance->tszInstanceName); auto it = state.joys.find(guid); - const bool exists = it != state.joys.end() && it->second->joy_handle != nullptr; + const bool exists = it != state.joys.end(); state.all.push_back(guid); -- cgit v1.2.3