From 7397a3c64e98ac77ac739bd250eb7b3cc36837c3 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Tue, 4 Jan 2022 19:26:23 +0000 Subject: [PATCH] Package level `nodeHeaderShift` --- internal/trie/node/header.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/trie/node/header.go b/internal/trie/node/header.go index 2d98a7ce3d..73b75c872c 100644 --- a/internal/trie/node/header.go +++ b/internal/trie/node/header.go @@ -8,13 +8,13 @@ import ( ) const ( - keyLenOffset = 0x3f + keyLenOffset = 0x3f + nodeHeaderShift = 6 ) // encodeHeader creates the encoded header for the branch. func (b *Branch) encodeHeader(writer io.Writer) (err error) { var header byte - const nodeHeaderShift = 6 if b.Value == nil { header = byte(BranchType) << nodeHeaderShift } else { @@ -45,7 +45,6 @@ func (b *Branch) encodeHeader(writer io.Writer) (err error) { // encodeHeader creates the encoded header for the leaf. func (l *Leaf) encodeHeader(writer io.Writer) (err error) { - const nodeHeaderShift = 6 header := byte(LeafType) << nodeHeaderShift if len(l.Key) < 63 {