We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d6d5a3 commit ed264a1Copy full SHA for ed264a1
eth/protocols/snap/range.go
@@ -74,8 +74,11 @@ func (r *hashRange) End() common.Hash {
74
75
// incHash returns the next hash, in lexicographical order (a.k.a plus one)
76
func incHash(h common.Hash) common.Hash {
77
- var a uint256.Int
78
- a.SetBytes32(h[:])
79
- a.AddUint64(&a, 1)
80
- return common.Hash(a.Bytes32())
+ for i := len(h) - 1; i >= 0; i-- {
+ h[i]++
+ if h[i] != 0 {
+ break
81
+ }
82
83
+ return h
84
}
0 commit comments