use system.move instead of system.shallowCopy if the GC mode requires it
This commit is contained in:
parent
68ce808db1
commit
60d64d1aef
14 changed files with 61 additions and 36 deletions
|
|
@ -399,11 +399,14 @@ proc hash(x: IndexEntry): Hash =
|
|||
result = result !& x.linkDesc.hash
|
||||
result = !$result
|
||||
|
||||
proc `<-`(a: var IndexEntry, b: IndexEntry) =
|
||||
shallowCopy a.keyword, b.keyword
|
||||
shallowCopy a.link, b.link
|
||||
shallowCopy a.linkTitle, b.linkTitle
|
||||
shallowCopy a.linkDesc, b.linkDesc
|
||||
when defined(gcDestructors):
|
||||
template `<-`(a, b: var IndexEntry) = a = move(b)
|
||||
else:
|
||||
proc `<-`(a: var IndexEntry, b: IndexEntry) =
|
||||
shallowCopy a.keyword, b.keyword
|
||||
shallowCopy a.link, b.link
|
||||
shallowCopy a.linkTitle, b.linkTitle
|
||||
shallowCopy a.linkDesc, b.linkDesc
|
||||
|
||||
proc sortIndex(a: var openArray[IndexEntry]) =
|
||||
# we use shellsort here; fast and simple
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue