Skip to content

Commit 74e8d2d

Browse files
authored
trie/utils: simplify codeChunkIndex (#29480)
minor simplification to the code
1 parent 27de7de commit 74e8d2d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

trie/utils/verkle.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,7 @@ func codeChunkIndex(chunk *uint256.Int) (*uint256.Int, byte) {
209209
chunkOffset = new(uint256.Int).Add(codeOffset, chunk)
210210
treeIndex, subIndexMod = new(uint256.Int).DivMod(chunkOffset, verkleNodeWidth, new(uint256.Int))
211211
)
212-
var subIndex byte
213-
if len(subIndexMod) != 0 {
214-
subIndex = byte(subIndexMod[0])
215-
}
216-
return treeIndex, subIndex
212+
return treeIndex, byte(subIndexMod.Uint64())
217213
}
218214

219215
// CodeChunkKey returns the verkle tree key of the code chunk for the

0 commit comments

Comments
 (0)