mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-27 09:43:58 +00:00
@@ -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.
|
||||
|
||||
@@ -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) {.
|
||||
|
||||
Reference in New Issue
Block a user