MCPcopy Create free account
hub / github.com/SmartPool/smartpool-client / ToNodeArray

Method ToNodeArray

mtree/branch.go:10–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8}
9
10func (b BranchNode) ToNodeArray() []NodeData {
11 if b.Left == nil && b.Right == nil {
12 return []NodeData{b.Hash}
13 }
14 left := b.Left.ToNodeArray()
15 right := b.Right.ToNodeArray()
16 if b.ElementOnTheLeft {
17 return append(left, right...)
18 } else {
19 return append(right, left...)
20 }
21}
22
23// explain the operation
24func AcceptLeftSibling(b *BranchNode, h NodeData) *BranchNode {

Callers 3

AllBranchesArrayMethod · 0.45
CounterBranchArrayMethod · 0.45
HashBranchArrayMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected