use system.move instead of system.shallowCopy if the GC mode requires it

This commit is contained in:
Andreas Rumpf 2019-10-03 16:46:09 +02:00
commit 60d64d1aef
14 changed files with 61 additions and 36 deletions

View file

@ -360,6 +360,8 @@ proc del*(t: StringTableRef, key: string) =
break
when defined(js):
t.data[j] = t.data[i]
elif defined(gcDestructors):
t.data[j] = move t.data[i]
else:
shallowCopy(t.data[j], t.data[i]) # data[j] will be marked EMPTY next loop