Index: ps/trunk/source/network/FSM.h =================================================================== --- ps/trunk/source/network/FSM.h +++ ps/trunk/source/network/FSM.h @@ -170,10 +170,10 @@ { size_t operator()(const TransitionKey& key) const noexcept { - static_assert(sizeof(UnderlyingType) <= sizeof(size_t) / 2); - return (static_cast(key.state) << - ((sizeof(size_t) / 2) * std::numeric_limits::digits)) + - static_cast(key.eventType); + constexpr size_t count{std::numeric_limits::digits / 2}; + const size_t wideState{static_cast(key.state)}; + const size_t rotatedState{(wideState << count) | (wideState >> count)}; + return static_cast(key.eventType) ^ rotatedState; } };