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
|
|
@ -302,12 +302,18 @@ template piRest*(my: XmlParser): string =
|
|||
proc rawData*(my: XmlParser): string {.inline.} =
|
||||
## returns the underlying 'data' string by reference.
|
||||
## This is only used for speed hacks.
|
||||
shallowCopy(result, my.a)
|
||||
when defined(gcDestructors):
|
||||
result = move(my.a)
|
||||
else:
|
||||
shallowCopy(result, my.a)
|
||||
|
||||
proc rawData2*(my: XmlParser): string {.inline.} =
|
||||
## returns the underlying second 'data' string by reference.
|
||||
## This is only used for speed hacks.
|
||||
shallowCopy(result, my.b)
|
||||
when defined(gcDestructors):
|
||||
result = move(my.b)
|
||||
else:
|
||||
shallowCopy(result, my.b)
|
||||
|
||||
proc getColumn*(my: XmlParser): int {.inline.} =
|
||||
## get the current column the parser has arrived at.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue