diff options
author | data-man <datamanrb@gmail.com> | 2018-06-08 19:29:19 +0300 |
---|---|---|
committer | data-man <datamanrb@gmail.com> | 2018-06-08 19:29:19 +0300 |
commit | 3e799d7876110d970c365d61c05e887729488e2f (patch) | |
tree | 31e3380841bc2f31090427b6b50d879b3ebda528 | |
parent | fbd91a474a86a5a52fe495df00e9a0e1bfa000df (diff) | |
download | Nim-3e799d7876110d970c365d61c05e887729488e2f.tar.gz |
Removed redundant conditions in CritBitTree.inc, speedup it.
-rw-r--r-- | lib/pure/collections/critbits.nim | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/pure/collections/critbits.nim b/lib/pure/collections/critbits.nim index 2ab65f002..c94e08098 100644 --- a/lib/pure/collections/critbits.nim +++ b/lib/pure/collections/critbits.nim @@ -165,11 +165,8 @@ proc containsOrIncl*(c: var CritBitTree[void], key: string): bool = proc inc*(c: var CritBitTree[int]; key: string, val: int = 1) = ## increments `c[key]` by `val`. - let oldCount = c.count var n = rawInsert(c, key) - if c.count >= oldCount or oldCount == 0: - # not a new key: - inc n.val, val + inc n.val, val proc incl*(c: var CritBitTree[void], key: string) = ## includes `key` in `c`. |