From 565c012554b4b0704c977fc2ece925eb31a6a67a Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 1 Apr 2022 18:18:51 +0300 Subject: [PATCH] Revert "use `rng.shuffle(mut indices) ?` again" This reverts commit 15ca57c3de8ddfe766559b0e7a8ab20ff7929c48. --- vlib/rand/rand.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/rand/rand.v b/vlib/rand/rand.v index 0201b4d3cb..ab7ccae57d 100644 --- a/vlib/rand/rand.v +++ b/vlib/rand/rand.v @@ -328,7 +328,7 @@ pub fn (mut rng PRNG) choose(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(mut indices) ? for i in 0 .. k { results[i] = array[indices[i]] }