Skip to content

Commit

Permalink
trie/utils: change Div+Mod to DivMod (ethereum#29413)
Browse files Browse the repository at this point in the history
* trie/utils: change Div+Mod to DivMod

* trie/utils: gofmt
  • Loading branch information
AaronChen0 authored and jorgemmsilva committed Jun 17, 2024
1 parent 7b06bc6 commit 0dda84c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions trie/utils/verkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,8 @@ func CodeSizeKey(address []byte) []byte {

func codeChunkIndex(chunk *uint256.Int) (*uint256.Int, byte) {
var (
chunkOffset = new(uint256.Int).Add(codeOffset, chunk)
treeIndex = new(uint256.Int).Div(chunkOffset, verkleNodeWidth)
subIndexMod = new(uint256.Int).Mod(chunkOffset, verkleNodeWidth)
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 {
Expand Down

0 comments on commit 0dda84c

Please sign in to comment.