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

@ -236,13 +236,19 @@ proc rawText*(n: XmlNode): string {.inline.} =
## Returns the underlying 'text' string by reference.
##
## This is only used for speed hacks.
shallowCopy(result, n.fText)
when defined(gcDestructors):
result = move(n.fText)
else:
shallowCopy(result, n.fText)
proc rawTag*(n: XmlNode): string {.inline.} =
## Returns the underlying 'tag' string by reference.
##
## This is only used for speed hacks.
shallowCopy(result, n.fTag)
when defined(gcDestructors):
result = move(n.fTag)
else:
shallowCopy(result, n.fTag)
proc innerText*(n: XmlNode): string =
## Gets the inner text of `n`: