示例#1
0
func NewTypeTree() *TypeTree {
	t := TypeTree{}
	t.tree = llrb.New(lessPtr)
	t.Index = 0
	emptyPtrNode = &llrb.Item{0, "", 0, 0}
	return &t
}
示例#2
0
文件: index.go 项目: kuba--/qrpc
// 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
}
示例#3
0
文件: zset.go 项目: brianbrunner/omg
func New() *ZSet {
	tree := llrb.New()
	set := make(map[string]int)
	zs := &ZSet{tree, set}
	return zs
}