From 0f344a70c992594c7d6b794a6c2dd6c4b5b14685 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Mon, 11 May 2020 19:12:40 +0200 Subject: fixes #13946 (#14302) --- lib/pure/parsexml.nim | 14 ++++---------- lib/pure/strtabs.nim | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/lib/pure/parsexml.nim b/lib/pure/parsexml.nim index a8e7aaab8..6ec77ebdb 100644 --- a/lib/pure/parsexml.nim +++ b/lib/pure/parsexml.nim @@ -299,21 +299,15 @@ template piRest*(my: XmlParser): string = assert(my.kind == xmlPI) my.b -proc rawData*(my: var XmlParser): string {.inline.} = +proc rawData*(my: var XmlParser): lent string {.inline.} = ## returns the underlying 'data' string by reference. ## This is only used for speed hacks. - when defined(gcDestructors): - result = move(my.a) - else: - shallowCopy(result, my.a) + result = my.a -proc rawData2*(my: var XmlParser): string {.inline.} = +proc rawData2*(my: var XmlParser): lent string {.inline.} = ## returns the underlying second 'data' string by reference. ## This is only used for speed hacks. - when defined(gcDestructors): - result = move(my.b) - else: - shallowCopy(result, my.b) + result = my.b proc getColumn*(my: XmlParser): int {.inline.} = ## get the current column the parser has arrived at. diff --git a/lib/pure/strtabs.nim b/lib/pure/strtabs.nim index 375f212cd..26811cc65 100644 --- a/lib/pure/strtabs.nim +++ b/lib/pure/strtabs.nim @@ -228,7 +228,7 @@ proc enlarge(t: StringTableRef) = var n: KeyValuePairSeq newSeq(n, len(t.data) * growthFactor) for i in countup(0, high(t.data)): - if t.data[i].hasValue: rawInsert(t, n, t.data[i].key, t.data[i].val) + if t.data[i].hasValue: rawInsert(t, n, move t.data[i].key, move t.data[i].val) swap(t.data, n) proc `[]=`*(t: StringTableRef, key, val: string) {. -- cgit 1.4.1-2-gfad0