This commit is contained in:
Antonis Geralis 2022-09-03 19:16:33 +03:00
parent 2c9a7a85d5
commit 343b634afb
2 changed files with 1 additions and 3 deletions

View File

@ -331,7 +331,7 @@ proc toData*[K, V](data: var openArray[byte]; pos: var int; input: (Table[K, V]|
proc fromData*[K, V](data: openArray[byte]; pos: var int; output: var (Table[K, V]|OrderedTable[K, V])) = proc fromData*[K, V](data: openArray[byte]; pos: var int; output: var (Table[K, V]|OrderedTable[K, V])) =
let len = readInt32(data, pos).int let len = readInt32(data, pos).int
for i in 0 ..< len: for i in 0..<len:
var key: K var key: K
fromData(data, pos, key) fromData(data, pos, key)
fromData(data, pos, mgetOrPut(output, key, default(V))) fromData(data, pos, mgetOrPut(output, key, default(V)))

View File

@ -571,8 +571,6 @@ template mutatorImpl*(target, mutator, typ: untyped) =
proc customMutatorImpl(x: var typ; data: openArray[byte]; maxLen: int; proc customMutatorImpl(x: var typ; data: openArray[byte]; maxLen: int;
r: var Rand): int {.nosan.} = r: var Rand): int {.nosan.} =
if data.len > 1: if data.len > 1:
#var pos = 1
#fromData(data, pos, x)
when (NimMajor, NimMinor, NimPatch) >= (1, 7, 1): when (NimMajor, NimMinor, NimPatch) >= (1, 7, 1):
x = move getInput(x, data) x = move getInput(x, data)
else: else: