From 4bef22d91bb72319f184719fdfa3ee872a261572 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 3 Oct 2016 23:42:31 +0200 Subject: logic/tracker: remove absurd microoptimization There's no benefit to using branchless arithmetic here. Retrieving a value is so complex it doesn't matter how many times we branch here. --- logic/tracker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/logic/tracker.cpp b/logic/tracker.cpp index 0d53c268..dc148eba 100644 --- a/logic/tracker.cpp +++ b/logic/tracker.cpp @@ -327,7 +327,8 @@ void Tracker::logic() value(i) = map(value(i), m(i)); for (int i = 0; i < 6; i++) - value(i) *= int(m(i).opts.invert) * -2 + 1; + if (m(i).opts.invert) + value(i) = -value(i); logger.write_pose(value); // "mapped" -- cgit v1.2.3