From 8830af5c896113f6369fbb52073170ff39af0081 Mon Sep 17 00:00:00 2001 From: yuyi Date: Thu, 12 May 2022 16:20:38 +0800 Subject: [PATCH] rand: minor cleanup in choose() (#14376) --- vlib/rand/rand.v | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vlib/rand/rand.v b/vlib/rand/rand.v index 88eddc009f..c030b481d5 100644 --- a/vlib/rand/rand.v +++ b/vlib/rand/rand.v @@ -327,9 +327,7 @@ pub fn (mut rng PRNG) choose(array []T, k int) ?[]T { } mut results := []T{len: k} mut indices := []int{len: n, init: it} - // TODO: see why exactly it is necessary to enfoce the type here in Checker.infer_fn_generic_types - // (v errors with: `inferred generic type T is ambiguous: got int, expected string`, when is missing) - rng.shuffle(mut indices) ? + rng.shuffle(mut indices) ? for i in 0 .. k { results[i] = array[indices[i]] }