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

more mutability fixes

This commit is contained in:
Alexander Medvednikov 2019-12-06 19:23:24 +03:00
parent e3b5d7fd7c
commit 55f32fc413
3 changed files with 4 additions and 3 deletions

View File

@ -39,7 +39,7 @@ pub mut:
}
fn new_automaton(f [][]int) Automaton {
mut maxy := f.len
maxy := f.len
mut maxx := 0
for y := 0; y<f.len; y++ {
if maxx < f[y].len {
@ -61,7 +61,7 @@ pub fn (aa mut Automaton) update() {
for y := 1; y<aa.field.maxy; y++ {
for x := 1; x<aa.field.maxx; x++ {
moore_sum := ( 0 +
aa.field.get(x-1,y-1) + aa.field.get(x,y-1) + aa.field.get(x+1,y-1) +
aa.field.get(x-1,y-1) + aa.field.get(x,y-1) + aa.field.get(x+1,y-1) +
aa.field.get(x-1,y ) + 0 + aa.field.get(x+1,y ) +
aa.field.get(x-1,y+1) + aa.field.get(x,y+1) + aa.field.get(x+1,y+1)
)

View File

@ -258,6 +258,7 @@ fn (p mut Parser) if_statement(is_expr bool, elif_depth int) string {
name: var_name
typ: typ
is_mut: false // TODO
is_used: true // TODO
//is_alloc: p.is_alloc || typ.starts_with('array_')
//line_nr: p.tokens[ var_token_idx ].line_nr
//token_idx: var_token_idx

View File

@ -30,7 +30,7 @@ pub fn (wg mut WaitGroup) done() {
wg.add(-1)
}
pub fn (wg mut WaitGroup) wait() {
pub fn (wg &WaitGroup) wait() {
for wg.active > 0 {
// Do not remove this, busy empty loops are optimized
// with -prod by some compilers, see issue #2874