Skip to content

Commit 15ff066

Browse files
authored
trie/utils: change Div+Mod to DivMod (#29413)
* trie/utils: change Div+Mod to DivMod * trie/utils: gofmt
1 parent e3bdd84 commit 15ff066

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

trie/utils/verkle.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,8 @@ func CodeSizeKey(address []byte) []byte {
206206

207207
func codeChunkIndex(chunk *uint256.Int) (*uint256.Int, byte) {
208208
var (
209-
chunkOffset = new(uint256.Int).Add(codeOffset, chunk)
210-
treeIndex = new(uint256.Int).Div(chunkOffset, verkleNodeWidth)
211-
subIndexMod = new(uint256.Int).Mod(chunkOffset, verkleNodeWidth)
209+
chunkOffset = new(uint256.Int).Add(codeOffset, chunk)
210+
treeIndex, subIndexMod = new(uint256.Int).DivMod(chunkOffset, verkleNodeWidth, new(uint256.Int))
212211
)
213212
var subIndex byte
214213
if len(subIndexMod) != 0 {

0 commit comments

Comments
 (0)