Skip to content

Commit

Permalink
Update internal/trie/node/header.go to use else if
Browse files Browse the repository at this point in the history
Co-authored-by: Eclésio Junior <[email protected]>
  • Loading branch information
qdm12 and EclesioMeloJunior authored Jun 2, 2022
1 parent 18518b7 commit ea0b6ed
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions internal/trie/node/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ func encodeHeader(node *Node, writer io.Writer) (err error) {
var header byte
if node.Type() == Leaf {
header = leafHeader
} else { // branch
if node.Value == nil {
header = branchHeader
} else {
header = branchWithValueHeader
} else if node.Value == nil {
header = branchHeader
} else {
header = branchWithValueHeader
}
}
header <<= nodeHeaderShift
Expand Down

0 comments on commit ea0b6ed

Please sign in to comment.