good morning!!!!

Skip to content
Snippets Groups Projects
Commit ea06da08 authored by Sarlor's avatar Sarlor Committed by Péter Szilágyi
Browse files

trie: avoid unnecessary slicing on shortnode decoding (#16917)

optimization code
parent feb6620c
No related branches found
No related tags found
No related merge requests found
......@@ -53,10 +53,9 @@ func hexToCompact(hex []byte) []byte {
func compactToHex(compact []byte) []byte {
base := keybytesToHex(compact)
base = base[:len(base)-1]
// apply terminator flag
if base[0] >= 2 {
base = append(base, 16)
// delete terminator flag
if base[0] < 2 {
base = base[:len(base)-1]
}
// apply odd flag
chop := 2 - base[0]&1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment