We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2381aa commit 950f8f7Copy full SHA for 950f8f7
libc/src/__support/CPP/bit.h
@@ -233,8 +233,7 @@ template <typename T, typename = cpp::enable_if_t<cpp::is_unsigned_v<T>>>
233
234
template <typename T, typename = cpp::enable_if_t<cpp::is_unsigned_v<T>>>
235
[[nodiscard]] LIBC_INLINE constexpr int first_leading_one(T value) {
236
- return value == static_cast<T>(0) ? 0
237
- : countl_zero<T>(static_cast<T>(value)) + 1;
+ return !value ? 0 : countl_zero<T>(static_cast<T>(value)) + 1;
238
}
239
240
} // namespace LIBC_NAMESPACE::cpp
0 commit comments