Skip to content

Commit

Permalink
chore: make bit_length const function
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpwang committed Jul 21, 2023
1 parent 08a16ce commit d1beb92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion halo2-base/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub(crate) fn decompose_u64_digits_to_limbs(
}

/// Returns the number of bits needed to represent the value of `x`.
pub fn bit_length(x: u64) -> usize {
pub const fn bit_length(x: u64) -> usize {
(u64::BITS - x.leading_zeros()) as usize
}

Expand Down

0 comments on commit d1beb92

Please sign in to comment.