From 74e8d2da97aacc2589d39584f6af74cb9d62ee3f Mon Sep 17 00:00:00 2001 From: Aaron Chen Date: Wed, 17 Apr 2024 14:24:30 +0800 Subject: [PATCH] trie/utils: simplify codeChunkIndex (#29480) minor simplification to the code --- 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..328b2d2527 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.Uint64()) } // CodeChunkKey returns the verkle tree key of the code chunk for the