trie/utils: simplify codeChunkIndex (#29480)
minor simplification to the code
This commit is contained in:
parent
27de7dec65
commit
74e8d2da97
|
@ -209,11 +209,7 @@ func codeChunkIndex(chunk *uint256.Int) (*uint256.Int, byte) {
|
||||||
chunkOffset = new(uint256.Int).Add(codeOffset, chunk)
|
chunkOffset = new(uint256.Int).Add(codeOffset, chunk)
|
||||||
treeIndex, subIndexMod = new(uint256.Int).DivMod(chunkOffset, verkleNodeWidth, new(uint256.Int))
|
treeIndex, subIndexMod = new(uint256.Int).DivMod(chunkOffset, verkleNodeWidth, new(uint256.Int))
|
||||||
)
|
)
|
||||||
var subIndex byte
|
return treeIndex, byte(subIndexMod.Uint64())
|
||||||
if len(subIndexMod) != 0 {
|
|
||||||
subIndex = byte(subIndexMod[0])
|
|
||||||
}
|
|
||||||
return treeIndex, subIndex
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CodeChunkKey returns the verkle tree key of the code chunk for the
|
// CodeChunkKey returns the verkle tree key of the code chunk for the
|
||||||
|
|
Loading…
Reference in New Issue