mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vlib: change [0;n]
to [0].repeat(n)
This commit is contained in:

committed by
Alexander Medvednikov

parent
602e472b8a
commit
f077fbd32d
@ -58,7 +58,7 @@ fn main() {
|
||||
}
|
||||
if ids.len > 10 {
|
||||
// ids = ids[:10]
|
||||
mut tmp := [0 ; 10]
|
||||
mut tmp := [0].repeat(10)
|
||||
for i := 0 ; i < 10 ; i++ {
|
||||
tmp[i] = ids[i]
|
||||
}
|
||||
|
@ -55,8 +55,8 @@ fn main() {
|
||||
else {
|
||||
n = 0
|
||||
}
|
||||
mut u := [f64(1.0);n]
|
||||
mut v := [f64(1.0);n]
|
||||
mut u := [f64(1.0)].repeat(n)
|
||||
mut v := [f64(1.0)].repeat(n)
|
||||
|
||||
for i := 0; i< 10; i++ {
|
||||
v.a_times_transp(u)
|
||||
|
@ -338,7 +338,7 @@ fn (g mut Game) draw_scene() {
|
||||
|
||||
fn parse_binary_tetro(t_ int) []Block {
|
||||
mut t := t_
|
||||
res := [Block{} ; 4]
|
||||
res := [Block{}].repeat(4)
|
||||
mut cnt := 0
|
||||
horizontal := t == 9// special case for the horizontal line
|
||||
for i := 0; i <= 3; i++ {
|
||||
|
Reference in New Issue
Block a user