diff options
Diffstat (limited to 'lib/pure/collections/tables.nim')
-rwxr-xr-x | lib/pure/collections/tables.nim | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim index 31b98a0cc..ccbfd9a40 100755 --- a/lib/pure/collections/tables.nim +++ b/lib/pure/collections/tables.nim @@ -127,16 +127,18 @@ template PutImpl() = else: AddImpl() -template HasKeyOrPutImpl() = - var index = RawGet(t, key) - if index >= 0: - t.data[index].val = val - result = true - else: - if mustRehash(len(t.data), t.counter): Enlarge(t) - RawInsert(t, t.data, key, val) - inc(t.counter) - result = false +when false: + # not yet used: + template HasKeyOrPutImpl() = + var index = RawGet(t, key) + if index >= 0: + t.data[index].val = val + result = true + else: + if mustRehash(len(t.data), t.counter): Enlarge(t) + RawInsert(t, t.data, key, val) + inc(t.counter) + result = false proc `[]=`*[A, B](t: var TTable[A, B], key: A, val: B) = ## puts a (key, value)-pair into `t`. |