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)
pow = uint16(1)
value = uint16(0)
bytes = []byte(path)
)
for i := 0; i < len(bytes); i++ {
for i := 0; i < len(path); i++ {
offset += pow
pow *= 16
}
for i := 0; i < len(bytes); i++ {
value = value*16 + uint16(bytes[i])
value = value*16 + uint16(path[i])
}
return offset + value
}