func (t *Immutable) Has(key Key) bool {
	if node := t.get(key); node != nil {
		return true
	}
	return false
}
Has returns whether or not the passed key exists.
package tickettreap
import (
	"bytes"
	"sort"
)
func cloneTreapNode(node *treapNode) *treapNode {
	return &treapNode{
		key:      node.key,
		value:    node.value,
		priority: node.priority,
		left:     node.left,
		right:    node.right,
	}
}
type Immutable struct {
	root  *treapNode
	count int
	totalSize uint64
}
func newImmutable(root *treapNode, count int, totalSize uint64) *Immutable {
	return &Immutable{root: root, count: count, totalSize: totalSize}
}
func (t *Immutable) Len() int {
	return t.count
}
func (t *Immutable) Size() uint64 {
	return t.totalSize
}
func (t *Immutable) get(key Key) *treapNode {
	for node := t.root; node != nil; {
		compareResult := bytes.Compare(key[:], node.key[:])
		if compareResult < 0 {
			node = node.left
			continue
		}
		if compareResult > 0 {
			node = node.right
			continue
		}
		return node
	}
	return nil
}