mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: rename it
to index
in array inits (#17543)
This commit is contained in:
@ -444,7 +444,7 @@ pub fn (mut rng PRNG) choose[T](array []T, k int) ![]T {
|
||||
return error('Cannot choose ${k} elements without replacement from a ${n}-element array.')
|
||||
}
|
||||
mut results := []T{len: k}
|
||||
mut indices := []int{len: n, init: it}
|
||||
mut indices := []int{len: n, init: index}
|
||||
rng.shuffle[int](mut indices)!
|
||||
for i in 0 .. k {
|
||||
results[i] = array[indices[i]]
|
||||
|
Reference in New Issue
Block a user