Commit 4e6c4212 authored by Petar Maymounkov's avatar Petar Maymounkov

Add FromKeysAtDepth.

parent 03dc1869
...@@ -28,6 +28,14 @@ func FromKeys(k []key.Key) *Trie { ...@@ -28,6 +28,14 @@ func FromKeys(k []key.Key) *Trie {
return t return t
} }
func FromKeysAtDepth(depth int, k []key.Key) *Trie {
t := New()
for _, k := range k {
t.AddAtDepth(depth, k)
}
return t
}
func (trie *Trie) String() string { func (trie *Trie) String() string {
b, _ := json.Marshal(trie) b, _ := json.Marshal(trie)
return string(b) return string(b)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment