trie/utils: change Div+Mod to DivMod (#29413)

* trie/utils: change Div+Mod to DivMod

* trie/utils: gofmt
pull/29453/head
Aaron Chen 7 months ago committed by GitHub
parent e3bdd84e98
commit 15ff066a24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      trie/utils/verkle.go

@ -206,9 +206,8 @@ func CodeSizeKey(address []byte) []byte {
func codeChunkIndex(chunk *uint256.Int) (*uint256.Int, byte) { func codeChunkIndex(chunk *uint256.Int) (*uint256.Int, byte) {
var ( var (
chunkOffset = new(uint256.Int).Add(codeOffset, chunk) chunkOffset = new(uint256.Int).Add(codeOffset, chunk)
treeIndex = new(uint256.Int).Div(chunkOffset, verkleNodeWidth) treeIndex, subIndexMod = new(uint256.Int).DivMod(chunkOffset, verkleNodeWidth, new(uint256.Int))
subIndexMod = new(uint256.Int).Mod(chunkOffset, verkleNodeWidth)
) )
var subIndex byte var subIndex byte
if len(subIndexMod) != 0 { if len(subIndexMod) != 0 {

Loading…
Cancel
Save