public byte[] Get(byte[] key) { if (!HasRoot) { return(null); } return(Get(root, TrieKey.FromNormal(key))); }
public void Delete(byte[] key) { TrieKey k = TrieKey.FromNormal(key); if (this.root != null) { this.root = Delete(this.root, k); } }
public void Put(byte[] key, byte[] value) { TrieKey k = TrieKey.FromNormal(key); if (this.root == null) { if (value != null && value.Length > 0) { this.root = new TrieNode(this, k, value); } } else { if (value == null || value.Length == 0) { this.root = Delete(this.root, k); } else { this.root = Insert(root, k, value); } } }