diff options
-rw-r--r-- | src/lib/utils/ct_utils.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/utils/ct_utils.h b/src/lib/utils/ct_utils.h index 0303d2a6c..63b8f4640 100644 --- a/src/lib/utils/ct_utils.h +++ b/src/lib/utils/ct_utils.h @@ -110,7 +110,8 @@ template<typename T> inline constexpr T select(T mask, T from0, T from1) { static_assert(std::is_unsigned<T>::value, "unsigned integer type required"); - return static_cast<T>((from0 & mask) | (from1 & ~mask)); + //return static_cast<T>((from0 & mask) | (from1 & ~mask)); + return static_cast<T>(from1 ^ (mask & (from0 ^ from1))); } template<typename T> |