From 5068a5aa016fef0b65c7cd6af27eeeefda0e5c95 Mon Sep 17 00:00:00 2001 From: Charles Blake Date: Fri, 13 Feb 2015 14:10:09 -0500 Subject: assignment -> shallowCopy for efficiency. --- lib/pure/collections/sets.nim | 2 +- lib/pure/collections/tables.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/pure/collections') diff --git a/lib/pure/collections/sets.nim b/lib/pure/collections/sets.nim index c25161ed0..4a20d00a4 100644 --- a/lib/pure/collections/sets.nim +++ b/lib/pure/collections/sets.nim @@ -276,7 +276,7 @@ proc excl*[A](s: var HashSet[A], key: A) = if isEmpty(s.data[i].hcode): # end of collision cluster; So all done return r = s.data[i].hcode and msk # "home" location of key@i - s.data[j] = s.data[i] # data[j] will be marked EMPTY next loop + shallowCopy(s.data[j], s.data[i]) # data[j] will be marked EMPTY next loop proc excl*[A](s: var HashSet[A], other: HashSet[A]) = ## Excludes everything in `other` from `s`. diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim index 58305b010..25fe306c0 100644 --- a/lib/pure/collections/tables.nim +++ b/lib/pure/collections/tables.nim @@ -287,7 +287,7 @@ proc del*[A, B](t: var Table[A, B], key: A) = if isEmpty(t.data[i].hcode): # end of collision cluster; So all done return r = t.data[i].hcode and msk # "home" location of key@i - t.data[j] = t.data[i] # data[j] will be marked EMPTY next loop + shallowCopy(t.data[j], t.data[i]) # data[j] will be marked EMPTY next loop proc initTable*[A, B](initialSize=64): Table[A, B] = ## creates a new hash table that is empty. -- cgit 1.4.1-2-gfad0