alternatively promote ref/seq to sizeof(T)
This commit is contained in:
parent
205afc493f
commit
a79790c6ed
|
@ -282,10 +282,10 @@ proc sample[T: SomeNumber](x: T; s: var Sampler; r: var Rand; res: var int) =
|
||||||
sampleAttempt(attempt(s, r, DefaultMutateWeight*sizeof(x), res))
|
sampleAttempt(attempt(s, r, DefaultMutateWeight*sizeof(x), res))
|
||||||
|
|
||||||
proc sample[T](x: seq[T]; s: var Sampler; r: var Rand; res: var int) =
|
proc sample[T](x: seq[T]; s: var Sampler; r: var Rand; res: var int) =
|
||||||
sampleAttempt(attempt(s, r, DefaultMutateWeight*sizeof(x), res))
|
sampleAttempt(attempt(s, r, DefaultMutateWeight*sizeof(pointer), res))
|
||||||
|
|
||||||
proc sample(x: string; s: var Sampler; r: var Rand; res: var int) =
|
proc sample(x: string; s: var Sampler; r: var Rand; res: var int) =
|
||||||
sampleAttempt(attempt(s, r, DefaultMutateWeight*sizeof(x), res))
|
sampleAttempt(attempt(s, r, DefaultMutateWeight*sizeof(pointer), res))
|
||||||
|
|
||||||
proc sample[T: tuple|object](x: T; s: var Sampler; r: var Rand; res: var int) =
|
proc sample[T: tuple|object](x: T; s: var Sampler; r: var Rand; res: var int) =
|
||||||
when compiles(mutate(x, 0, false, r)):
|
when compiles(mutate(x, 0, false, r)):
|
||||||
|
|
Loading…
Reference in New Issue