summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-12-06 08:47:18 +0100
committerGitHub <noreply@github.com>2016-12-06 08:47:18 +0100
commit633eb8a1e57de8e11fcde93a5aa133a39174495f (patch)
tree6320c178e670ee13d5b8133aafb91eb460e9163b /lib
parent5a82747d7c743c80eeb45452662fabfb69121131 (diff)
parent4423da465a7817353bf4f368ca661eaad8d9203a (diff)
downloadNim-633eb8a1e57de8e11fcde93a5aa133a39174495f.tar.gz
Merge pull request #5099 from yglukhov/workaround-5098
Workaround for #5098
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/collections/tableimpl.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/pure/collections/tableimpl.nim b/lib/pure/collections/tableimpl.nim
index 674fdddd2..5e871f08b 100644
--- a/lib/pure/collections/tableimpl.nim
+++ b/lib/pure/collections/tableimpl.nim
@@ -116,16 +116,15 @@ template hasKeyOrPutImpl(enlarge) {.dirty.} =
     maybeRehashPutImpl(enlarge)
   else: result = true
 
-proc default[T](t: typedesc[T]): T {.inline.} = discard
+template default[T](t: typedesc[T]): T =
+  var v: T
+  v
 
 template delImpl() {.dirty.} =
   var hc: Hash
   var i = rawGet(t, key, hc)
   let msk = maxHash(t)
   if i >= 0:
-    t.data[i].hcode = 0
-    t.data[i].key = default(type(t.data[i].key))
-    t.data[i].val = default(type(t.data[i].val))
     dec(t.counter)
     block outer:
       while true:         # KnuthV3 Algo6.4R adapted for i=i+1 instead of i=i-1