parent
3131c279ad
commit
565c012554
|
|
@ -328,7 +328,7 @@ pub fn (mut rng PRNG) choose<T>(array []T, k int) ?[]T {
|
|||
mut results := []T{len: k}
|
||||
mut indices := []int{len: n, init: it}
|
||||
// enfoce the type to int to avoid ambiguity
|
||||
rng.shuffle(mut indices) ?
|
||||
rng.shuffle<int>(mut indices) ?
|
||||
for i in 0 .. k {
|
||||
results[i] = array[indices[i]]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue