示例#1
0
func chan_to_tree(channel <-chan Item, filtered bool) (tree *llrb_tree.Tree) {
	tree = llrb_tree.Make(filtered)
	for item := range channel {
		tree.Insert(item)
	}
	return
}
示例#2
0
func slice_to_tree(slice []Item, filtered bool) (tree *llrb_tree.Tree) {
	tree = llrb_tree.Make(filtered)
	for _, item := range slice {
		tree.Insert(item)
	}
	return
}