diff options
author | Araq <rumpf_a@web.de> | 2011-11-19 02:05:16 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-11-19 02:05:16 +0100 |
commit | 62aa8bed3b6472e8acae530f7014e7e5b0c755b5 (patch) | |
tree | 59b52d3d7f1b310cc4ae5f6f58e4d1b3b7ccb47f /lib/pure/collections/tables.nim | |
parent | a497b4d1cf529b24ac469e701cb60e8d8b5fdefc (diff) | |
download | Nim-62aa8bed3b6472e8acae530f7014e7e5b0c755b5.tar.gz |
tester: threading tests added
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`. |