1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

stats: use c style for loop

This commit is contained in:
Daren Liang
2019-11-05 20:45:05 -05:00
committed by Alexander Medvednikov
parent af81b02ef0
commit 91bb969ed1
2 changed files with 1 additions and 4 deletions

View File

@@ -118,13 +118,11 @@ pub fn mode(arr []f64) f64 {
for v in arr {
freqs<<freq(arr,v)
}
mut i := 0
mut max := 0
for i < freqs.len {
for i := 0; i < freqs.len; i++ {
if freqs[i] > freqs[max] {
max = i
}
i++
}
return arr[max]
}