summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-10-03 23:42:31 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-10-03 23:42:31 +0200
commit4bef22d91bb72319f184719fdfa3ee872a261572 (patch)
tree131e7a4969d8fa8445f31d22da8f1b1d8ee060bb
parent136ab83b2352d6aa797094b804330d4bb0d18a5a (diff)
logic/tracker: remove absurd microoptimization
There's no benefit to using branchless arithmetic here. Retrieving a value<bool> is so complex it doesn't matter how many times we branch here.
-rw-r--r--logic/tracker.cpp3
1 files changed, 2 insertions, 1 deletions
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"