From d9bf577f9203bc49384266e0acbf6c5b299a71de Mon Sep 17 00:00:00 2001 From: Aaron Chen Date: Sun, 7 Apr 2024 18:46:45 +0800 Subject: [PATCH] trie/utils: simplify codeChunkIndex --- trie/utils/verkle.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/trie/utils/verkle.go b/trie/utils/verkle.go index 52e41f5243..8dce9d803b 100644 --- a/trie/utils/verkle.go +++ b/trie/utils/verkle.go @@ -209,11 +209,7 @@ func codeChunkIndex(chunk *uint256.Int) (*uint256.Int, byte) { 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 { - subIndex = byte(subIndexMod[0]) - } - return treeIndex, subIndex + return treeIndex, byte(subIndexMod[0]) } // CodeChunkKey returns the verkle tree key of the code chunk for the