mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 15:10:19 +00:00
AK: Fix doc comment for bit_scan_forward
The original doc comment was mistakenly copy-pasted from count_leading_zeroes_safe, and incorrect. The function is doing something else: it's counting _trailing_ zeroes instead of _leading_ ones.
This commit is contained in:
parent
a673062084
commit
de73572b3d
Notes:
sideshowbarker
2024-07-16 23:34:44 +09:00
Author: https://github.com/Janiczek Commit: https://github.com/SerenityOS/serenity/commit/de73572b3d Pull-request: https://github.com/SerenityOS/serenity/pull/21415
1 changed files with 4 additions and 3 deletions
|
@ -128,9 +128,10 @@ inline constexpr int count_leading_zeroes_safe(IntType value)
|
||||||
return count_leading_zeroes(value);
|
return count_leading_zeroes(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The function will return the number of leading zeroes in the type. If
|
// Returns one plus the index of the least significant 1-bit of x, or if x is
|
||||||
// the given number is zero, this function will return the number of bits
|
// zero, returns zero. (See __builtin_ffs.)
|
||||||
// in the IntType.
|
//
|
||||||
|
// For numbers above zero, bit_scan_forward(n) == count_trailing_zeroes(n) + 1.
|
||||||
template<Integral IntType>
|
template<Integral IntType>
|
||||||
inline constexpr int bit_scan_forward(IntType value)
|
inline constexpr int bit_scan_forward(IntType value)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue