From 15ff066a24964ea16742420abecc7e4ae5e9bce0 Mon Sep 17 00:00:00 2001 From: Aaron Chen Date: Thu, 4 Apr 2024 21:52:38 +0800 Subject: [PATCH] trie/utils: change Div+Mod to DivMod (#29413) * trie/utils: change Div+Mod to DivMod * trie/utils: gofmt --- trie/utils/verkle.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/trie/utils/verkle.go b/trie/utils/verkle.go index ce059edc64..52e41f5243 100644 --- a/trie/utils/verkle.go +++ b/trie/utils/verkle.go @@ -206,9 +206,8 @@ func CodeSizeKey(address []byte) []byte { func codeChunkIndex(chunk *uint256.Int) (*uint256.Int, byte) { var ( - chunkOffset = new(uint256.Int).Add(codeOffset, chunk) - treeIndex = new(uint256.Int).Div(chunkOffset, verkleNodeWidth) - subIndexMod = new(uint256.Int).Mod(chunkOffset, verkleNodeWidth) + chunkOffset = new(uint256.Int).Add(codeOffset, chunk) + treeIndex, subIndexMod = new(uint256.Int).DivMod(chunkOffset, verkleNodeWidth, new(uint256.Int)) ) var subIndex byte if len(subIndexMod) != 0 {