Skip to content

Commit 70a2e1b

Browse files
authored
📝 countZeroBytes fix Natspec, regen docs (#1413)
1 parent ed9c774 commit 70a2e1b

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

docs/utils/libbit.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ function popCount(uint256 x) internal pure returns (uint256 c)
5353

5454
Returns the number of set bits in `x`.
5555

56+
### countZeroBytes(uint256)
57+
58+
```solidity
59+
function countZeroBytes(uint256 x) internal pure returns (uint256 c)
60+
```
61+
62+
Returns the number of zero bytes in `x`.
63+
To get the number of non-zero bytes, simply do `32 - countZeroBytes(x)`.
64+
5665
### isPo2(uint256)
5766

5867
```solidity

src/utils/LibBit.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ library LibBit {
8181
}
8282
}
8383

84-
/// @dev Returns the number of zero bits in `x`.
85-
/// To get the number of non-zero bytes, simply do `32 - countZeroBytes(x)`
84+
/// @dev Returns the number of zero bytes in `x`.
85+
/// To get the number of non-zero bytes, simply do `32 - countZeroBytes(x)`.
8686
function countZeroBytes(uint256 x) internal pure returns (uint256 c) {
8787
/// @solidity memory-safe-assembly
8888
assembly {

0 commit comments

Comments
 (0)