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

arrays: fix range

This commit is contained in:
Alexander Medvednikov 2019-10-30 17:30:49 +03:00
parent a9ca9f45af
commit 316cf025ae

View File

@ -1,8 +1,8 @@
module arrays
fn range<T>(start, end T) []T {
mut res := [T(0)]
for i := start; i < end; i++ {
mut res := [start]
for i := start + 1; i < end; i++ {
res << i
}
return res