Skip to content

Commit 8830af5

Browse files
authored
rand: minor cleanup in choose() (#14376)
1 parent 5bc4fea commit 8830af5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

vlib/rand/rand.v

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,7 @@ pub fn (mut rng PRNG) choose<T>(array []T, k int) ?[]T {
327327
}
328328
mut results := []T{len: k}
329329
mut indices := []int{len: n, init: it}
330-
// TODO: see why exactly it is necessary to enfoce the type here in Checker.infer_fn_generic_types
331-
// (v errors with: `inferred generic type T is ambiguous: got int, expected string`, when <int> is missing)
332-
rng.shuffle<int>(mut indices) ?
330+
rng.shuffle(mut indices) ?
333331
for i in 0 .. k {
334332
results[i] = array[indices[i]]
335333
}

0 commit comments

Comments
 (0)