summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-11-12 08:48:51 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-11-12 08:48:51 +0100
commit798f6e9076855bf7769aba8abde4d570960d0755 (patch)
tree064bb8ec1f34a049bf852cf10a78700d37f21e78
parentafc6da0a17eec9e1da31a79c610a8f090507b39e (diff)
joy: remove branching
-rw-r--r--opentrack/win32-joystick-shortcuts.hpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/opentrack/win32-joystick-shortcuts.hpp b/opentrack/win32-joystick-shortcuts.hpp
index f3bca827..e54596bd 100644
--- a/opentrack/win32-joystick-shortcuts.hpp
+++ b/opentrack/win32-joystick-shortcuts.hpp
@@ -67,9 +67,6 @@ struct win32_joy_ctx
{
HRESULT hr;
bool ok = false;
-
- if (first_timer.elapsed_ms() > first_event_delay_ms)
- first = true;
for (int i = 0; i < 5; i++)
{
@@ -99,6 +96,8 @@ struct win32_joy_ctx
qDebug() << "joy get state failed" << guid << hr;
return false;
}
+
+ first |= first_timer.elapsed_ms() > first_event_delay_ms;
for (int i = 0; i < 128; i++)
{