From f33de1bc64efa9801ed547764385eee7ae8a3e4e Mon Sep 17 00:00:00 2001 From: yuyi Date: Tue, 12 May 2020 19:57:23 +0800 Subject: [PATCH] all: fix unused variable warnings --- examples/nbody.v | 2 +- examples/tetris/tetris.v | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/nbody.v b/examples/nbody.v index 7ec43f1874..3ffe14bfa4 100644 --- a/examples/nbody.v +++ b/examples/nbody.v @@ -124,7 +124,7 @@ sys := &System {arr_momentum(), arr_position()} offsetmomentum(mut sys) println('${energy(sys):.9f}') //-0.169075164 -for i in 0..50000000 { +for _ in 0..50000000 { advance(mut sys, 0.01) } println('${energy(sys):.9f}') //-0.169059907 diff --git a/examples/tetris/tetris.v b/examples/tetris/tetris.v index 2ce6fe4498..a23f2d9cc0 100644 --- a/examples/tetris/tetris.v +++ b/examples/tetris/tetris.v @@ -189,7 +189,7 @@ fn (g mut Game) init_game() { g.generate_tetro() g.field = [] // TODO: g.field = [][]int // Generate the field, fill it with 0's, add -1's on each edge - for i in 0..FieldHeight + 2 { + for _ in 0..FieldHeight + 2 { mut row := [0].repeat(FieldWidth + 2) row[0] = - 1 row[FieldWidth + 1] = - 1