mirror of
https://github.com/boostorg/atomic.git
synced 2026-02-01 20:12:09 +00:00
Microoptimization to reduce the number of branches in 128-bit operator==.
This commit is contained in:
@@ -164,7 +164,7 @@ struct BOOST_ATOMIC_DETAIL_MAY_ALIAS storage128_t
|
||||
|
||||
BOOST_FORCEINLINE bool operator== (storage128_t const& left, storage128_t const& right) BOOST_NOEXCEPT
|
||||
{
|
||||
return left.data[0] == right.data[0] && left.data[1] == right.data[1];
|
||||
return ((left.data[0] ^ right.data[0]) | (left.data[1] ^ right.data[1])) == 0u;
|
||||
}
|
||||
BOOST_FORCEINLINE bool operator!= (storage128_t const& left, storage128_t const& right) BOOST_NOEXCEPT
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user