Update history_trienode_utils.go

This commit is contained in:
marukai67 2026-02-06 16:21:30 +01:00 committed by GitHub
parent 777265620d
commit 69ca8277b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -82,14 +82,11 @@ func hexPathNodeID(path string) uint16 {
offset = uint16(0) offset = uint16(0)
pow = uint16(1) pow = uint16(1)
value = uint16(0) value = uint16(0)
bytes = []byte(path)
) )
for i := 0; i < len(bytes); i++ { for i := 0; i < len(path); i++ {
offset += pow offset += pow
pow *= 16 pow *= 16
} value = value*16 + uint16(path[i])
for i := 0; i < len(bytes); i++ {
value = value*16 + uint16(bytes[i])
} }
return offset + value return offset + value
} }