Skip to content

Commit

Permalink
Merge pull request #130 from ralexstokes/update-log-2
Browse files Browse the repository at this point in the history
update `log_2` for compatibility with proof verification
  • Loading branch information
ralexstokes authored Mar 28, 2024
2 parents ec96b6c + f608fba commit b0e5350
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ssz-rs/src/merkleization/multiproofs/generalized_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::merkleization::MerkleizationError as Error;

// Return base 2 logarithm of `x`.
// `None` is returned if `x` is `0` as this logarithm is undefined.
pub fn log_2(x: usize) -> Option<usize> {
x.checked_ilog2().map(|x| x as usize)
pub fn log_2(x: usize) -> Option<u32> {
x.checked_ilog2()
}

pub fn get_power_of_two_ceil(x: usize) -> usize {
Expand Down

0 comments on commit b0e5350

Please sign in to comment.