Skip to content

Commit

Permalink
Add precaution for use of BitCounter::ntz
Browse files Browse the repository at this point in the history
  • Loading branch information
fenrir-naru committed Nov 12, 2024
1 parent 1589e6b commit 6e2dfa1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tool/util/bit_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ struct BitCounter {

/**
* Count rightmost zeros before the first one (Number of trailing zeros)
* Be careful, if input equals to 0, then total number of corresponding type bits
* will be returned like (unsigned int)0 => 32.
* @param bits results
*/
static T ntz(const T &v) {
Expand Down

0 comments on commit 6e2dfa1

Please sign in to comment.