Skip to content

Commit

Permalink
Package level nodeHeaderShift
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jan 5, 2022
1 parent aed41cd commit 7397a3c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/trie/node/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 7397a3c

Please sign in to comment.