Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.

Commit b268250

Browse files
committed
fix: functions visibility
1 parent 7f5e268 commit b268250

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/LogarithmicBuckets.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ library LogarithmicBuckets {
106106
if (_buckets.buckets[_bucket].insert(_id, _head)) _buckets.bucketsMask |= _bucket;
107107
}
108108

109+
/// PURE HELPERS ///
110+
109111
/// @notice Returns the bucket in which the given value would fall.
110112
function computeBucket(uint256 _value) internal pure returns (uint256) {
111113
uint256 lowerMask = setLowerBits(_value);

test/TestLogarithmicBuckets.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ contract TestLogarithmicBuckets is LogarithmicBucketsMock, Test {
134134

135135
function testProveNextBucket(uint256 _value) public {
136136
uint256 curr = LogarithmicBuckets.computeBucket(_value);
137-
uint256 next = nextBucket(_value);
137+
uint256 next = nextBucketValue(_value);
138138
uint256 bucketsMask = buckets.bucketsMask;
139139
// check that `next` is a strictly higer non-empty bucket, or zero
140140
assertTrue(next == 0 || isPowerOfTwo(next));
@@ -151,7 +151,7 @@ contract TestLogarithmicBuckets is LogarithmicBucketsMock, Test {
151151

152152
function testProvePrevBucket(uint256 _value) public {
153153
uint256 curr = LogarithmicBuckets.computeBucket(_value);
154-
uint256 prev = prevBucket(_value);
154+
uint256 prev = prevBucketValue(_value);
155155
uint256 bucketsMask = buckets.bucketsMask;
156156
// check that `prev` is a non-empty bucket that is lower than or equal to `curr`; or zero
157157
assertTrue(prev == 0 || isPowerOfTwo(prev));

test/mocks/LogarithmicBucketsMock.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ contract LogarithmicBucketsMock {
4848
return true;
4949
}
5050

51-
function nextBucket(uint256 _value) internal view returns (uint256) {
51+
function nextBucketValue(uint256 _value) internal view returns (uint256) {
5252
uint256 bucketsMask = buckets.bucketsMask;
5353
uint256 lowerMask = LogarithmicBuckets.setLowerBits(_value);
5454
return LogarithmicBuckets.nextBucket(lowerMask, bucketsMask);
5555
}
5656

57-
function prevBucket(uint256 _value) internal view returns (uint256) {
57+
function prevBucketValue(uint256 _value) internal view returns (uint256) {
5858
uint256 bucketsMask = buckets.bucketsMask;
5959
uint256 lowerMask = LogarithmicBuckets.setLowerBits(_value);
6060
return LogarithmicBuckets.prevBucket(lowerMask, bucketsMask);

0 commit comments

Comments
 (0)