diff options
author | bptato <nincsnevem662@gmail.com> | 2022-07-12 18:12:55 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-07-12 18:12:55 +0200 |
commit | 2f0ea08df1e6884da51ea510cc352395e853cfc0 (patch) | |
tree | 214aef273f772a8ad657039097cb7c9134ba9f7d /src/utils | |
parent | 1abd3aadf0c999c6e26ba4e7910b5abe3510c6c2 (diff) | |
download | chawan-2f0ea08df1e6884da51ea510cc352395e853cfc0.tar.gz |
Fix a tokenizer bug, clean up some warnings
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/radixtree.nim | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/utils/radixtree.nim b/src/utils/radixtree.nim index f4ef5fb0..1ea32997 100644 --- a/src/utils/radixtree.nim +++ b/src/utils/radixtree.nim @@ -43,20 +43,20 @@ iterator keys*[T](node: RadixNode[T]): string = yield node.children[i].k inc i -func contains[T](node: RadixNode[T], k: string): bool = - var i = 0 - while i < node.children.len: - if node.children[i].k[0] == k[0]: - if k.len != node.children[i].k.len: - return false - var j = 1 - while j < k.len: - if node.children[i].k[j] != k[j]: - return false - inc j - return true - inc i - return false +#func contains[T](node: RadixNode[T], k: string): bool = +# var i = 0 +# while i < node.children.len: +# if node.children[i].k[0] == k[0]: +# if k.len != node.children[i].k.len: +# return false +# var j = 1 +# while j < k.len: +# if node.children[i].k[j] != k[j]: +# return false +# inc j +# return true +# inc i +# return false # O(1) add procedures for insert proc add[T](node: RadixNode[T], k: string, v: T) = |