Skip to content

Commit

Permalink
Handle evicted nodes during dump().
Browse files Browse the repository at this point in the history
  • Loading branch information
steveyen committed Nov 10, 2013
1 parent 42cfe87 commit bff8cf0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion node.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ func dump(o *Store, n *nodeLoc, level int) {
nNode, _ := n.read(o)
dump(o, &nNode.left, level+1)
dumpIndent(level)
fmt.Printf("%p - %v\n", nNode, string(nNode.item.Item().Key))
k := "<evicted>"
if nNode.item.Item() != nil {
k = string(nNode.item.Item().Key)
}
fmt.Printf("%p - %v\n", nNode, k)
dump(o, &nNode.right, level+1)
}

Expand Down

0 comments on commit bff8cf0

Please sign in to comment.