mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 19:02:18 +00:00
assignment -> shallowCopy for efficiency.
This commit is contained in:
@@ -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`.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user