There's no need to explicitly check for the maximum value, because the
function we call handles it correctly anyway.
libstdc++-v3/ChangeLog:
PR libstdc++/98226
* include/std/bit (__countl_one, __countr_one): Remove redundant
branches.
constexpr int
__countl_one(_Tp __x) noexcept
{
- if (__x == __gnu_cxx::__int_traits<_Tp>::__max)
- return __gnu_cxx::__int_traits<_Tp>::__digits;
return std::__countl_zero<_Tp>((_Tp)~__x);
}
constexpr int
__countr_one(_Tp __x) noexcept
{
- if (__x == __gnu_cxx::__int_traits<_Tp>::__max)
- return __gnu_cxx::__int_traits<_Tp>::__digits;
return std::__countr_zero((_Tp)~__x);
}