Exemple #1
0
func NewTypeTree() *TypeTree {
	t := TypeTree{}
	t.tree = llrb.New(lessPtr)
	t.Index = 0
	emptyPtrNode = &llrb.Item{0, "", 0, 0}
	return &t
}
Exemple #2
0
// rebuildIndex does the work of regenerating the index
// with the given keys.
func rebuild(less LessFunction, keys <-chan string) *llrb.LLRB {
	tree := llrb.New()
	for key := range keys {
		tree.ReplaceOrInsert(llrbString{s: key, l: less})
	}
	return tree
}
Exemple #3
0
func New() *ZSet {
	tree := llrb.New()
	set := make(map[string]int)
	zs := &ZSet{tree, set}
	return zs
}