arrays: fix range

pull/2592/head
Alexander Medvednikov 2019-10-30 17:30:49 +03:00
parent a9ca9f45af
commit 316cf025ae
1 changed files with 2 additions and 2 deletions

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