diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-10-03 23:42:31 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-10-03 23:42:31 +0200 |
commit | 4bef22d91bb72319f184719fdfa3ee872a261572 (patch) | |
tree | 131e7a4969d8fa8445f31d22da8f1b1d8ee060bb | |
parent | 136ab83b2352d6aa797094b804330d4bb0d18a5a (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.cpp | 3 |
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" |