Skip to content

Commit

Permalink
merged main
Browse files Browse the repository at this point in the history
  • Loading branch information
S1nus committed Jul 31, 2024
2 parents b083ebb + 57c8c01 commit 630af96
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/lib/tree/Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ function _getSplitPoint(uint256 x) pure returns (uint256) {
/// not overlap `end`.
/// @param begin Begin index, inclusive.
/// @param end End index, exclusive.
function nextSubtreeSize(uint256 begin, uint256 end) pure returns (uint256) {
uint256 ideal = bitsTrailingZeroes(begin);
function _nextSubtreeSize(uint256 begin, uint256 end) pure returns (uint256) {
uint256 ideal = _bitsTrailingZeroes(begin);
uint256 max = _bitsLen(end - begin) - 1;
if (ideal > max) {
return 1 << max;
Expand All @@ -93,7 +93,7 @@ function nextSubtreeSize(uint256 begin, uint256 end) pure returns (uint256) {
/// @notice Returns the number of trailing zero bits in `x`; the result is
/// 256 for `x` == 0.
/// @param x Number.
function bitsTrailingZeroes(uint256 x) pure returns (uint256) {
function _bitsTrailingZeroes(uint256 x) pure returns (uint256) {
uint256 mask = 1;
uint256 count = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/binary/BinaryMerkleTree.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ library BinaryMerkleTree {
bytes32[] memory leftSubtrees = new bytes32[](proof.sideNodes.length);

for (uint256 i = 0; leafIndex != proof.beginKey && i < proof.sideNodes.length; ++i) {
uint256 subtreeSize = nextSubtreeSize(leafIndex, proof.beginKey);
uint256 subtreeSize = _nextSubtreeSize(leafIndex, proof.beginKey);
leftSubtrees[i] = proof.sideNodes[i];
leafIndex += subtreeSize;
}
Expand Down
Loading

0 comments on commit 630af96

Please sign in to comment.