From e06a1b18e2efe0cff368d53e402c0edc4d15cab5 Mon Sep 17 00:00:00 2001 From: Antonis Geralis Date: Mon, 5 Sep 2022 19:28:34 +0300 Subject: [PATCH] fix older nim --- drchaos/mutator.nim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drchaos/mutator.nim b/drchaos/mutator.nim index 440d337..c294696 100644 --- a/drchaos/mutator.nim +++ b/drchaos/mutator.nim @@ -585,7 +585,10 @@ template mutatorImpl*(target, mutator, typ: untyped) = proc mgetInput(x: var typ; data: openArray[byte]) = if equals(data, buffer): - x = move cached + when (NimMajor, NimMinor, NimPatch) >= (1, 7, 1): + x = move cached + else: + x = cached else: var pos = 1 fromData(data, pos, x) @@ -610,10 +613,7 @@ template mutatorImpl*(target, mutator, typ: untyped) = var r = initRand(seed) var x: typ if data.len > 1: - when (NimMajor, NimMinor, NimPatch) >= (1, 7, 1): - mgetInput(x, data) - else: - x = getInput(x, data) + mgetInput(x, data) else: x = default(typeof(x)) FuzzMutator(mutator)(x, maxLen-x.byteSize, r)