Skip to content

Commit

Permalink
remove debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
catShaark committed Oct 5, 2022
1 parent 61a4e0b commit 99aeb4b
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions mutable_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,6 @@ func (tree *MutableTree) recursiveSet(node *Node, key []byte, value []byte, orph

switch bytes.Compare(key, node.key) {
case -1:
if bytes.Equal(key, evilKey) {
fmt.Println("case -1")
}
return &Node{
key: node.key,
subtreeHeight: 1,
Expand All @@ -269,10 +266,6 @@ func (tree *MutableTree) recursiveSet(node *Node, key []byte, value []byte, orph
version: version,
}, false, nil
case 1:
if bytes.Equal(key, evilKey) {
fmt.Println("case 1")
fmt.Println(node.String())
}
return &Node{
key: key,
subtreeHeight: 1,
Expand Down Expand Up @@ -335,7 +328,6 @@ func (tree *MutableTree) recursiveSet(node *Node, key []byte, value []byte, orph
func (tree *MutableTree) Remove(key []byte) ([]byte, bool, error) {
val, orphaned, removed, err := tree.remove(key)
if err != nil {
fmt.Println("s")
return nil, false, err
}

Expand Down Expand Up @@ -368,7 +360,6 @@ func (tree *MutableTree) remove(key []byte) (value []byte, orphaned []*Node, rem

tree.root, err = tree.ndb.GetNode(newNodeKey)
if err != nil {
fmt.Println("s")
return nil, nil, false, err
}
tree.root.hash = newRootHash
Expand Down Expand Up @@ -414,9 +405,6 @@ func (tree *MutableTree) recursiveRemove(node *Node, key []byte, orphans *[]*Nod
*orphans = append(*orphans, node)
if newLeftHash == nil && newLeftNode == nil { // left node held value, was removed
// this node become exactly its right node if
if node.rightHash != nil && node.rightNode == nil {
fmt.Println(node.rightHash, value, "value")
}
return node.rightHash, node.rightChildNodeKey, node.rightNode, node.key, value, nil
}

Expand All @@ -435,9 +423,6 @@ func (tree *MutableTree) recursiveRemove(node *Node, key []byte, orphans *[]*Nod
return nil, nil, nil, nil, nil, err
}

if newNode.hash != nil && newNode == nil {
fmt.Println(newNode.hash)
}
return newNode.hash, newNode.nodeKey, newNode, newKey, value, nil
}
// node.key >= key; either found or look to the right:
Expand All @@ -454,9 +439,6 @@ func (tree *MutableTree) recursiveRemove(node *Node, key []byte, orphans *[]*Nod
}
*orphans = append(*orphans, node)
if newRightHash == nil && newRightNode == nil { // right node held value, was removed
if node.leftHash != nil && node.leftNode == nil {
fmt.Println(node.leftHash, value, "value")
}
return node.leftHash, node.leftChildNodeKey, node.leftNode, nil, value, nil
}

Expand All @@ -479,9 +461,6 @@ func (tree *MutableTree) recursiveRemove(node *Node, key []byte, orphans *[]*Nod
return nil, nil, nil, nil, nil, err
}

if newNode.hash != nil && newNode == nil {
fmt.Println(newNode.hash)
}
return newNode.hash, newNode.nodeKey, newNode, nil, value, nil
}

Expand Down

0 comments on commit 99aeb4b

Please sign in to comment.