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 }
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 }