rsx: Revert use of std::has_single_bit

- Zero is not a power of 2 in this situation, and we do not want to treat it as such
This commit is contained in:
kd-11 2021-08-04 20:05:56 +03:00 committed by kd-11
parent daa8265a47
commit da3c9948e6

View file

@ -14,10 +14,10 @@ namespace utils
return std::span<T>(bless<T>(span.data()), sizeof(U) * span.size() / sizeof(T));
}
template <typename T>
template <typename T> requires(std::is_integral_v<T> && std::is_unsigned_v<T>)
bool is_power_of_2(T value)
{
return std::has_single_bit(value);
return !(value & (value - 1));
}
}