mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: simplify return if ... constructs to make more code compatible with -autofree
This commit is contained in:
@@ -1262,7 +1262,10 @@ fn (mut s Scanner) ident_char() string {
|
||||
}
|
||||
}
|
||||
// Escapes a `'` character
|
||||
return if c == "'" { '\\' + c } else { c }
|
||||
if c == "'" {
|
||||
return '\\' + c
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
[inline]
|
||||
|
||||
@@ -705,11 +705,10 @@ pub fn (mut t Table) find_or_register_array(elem_type Type) int {
|
||||
}
|
||||
|
||||
pub fn (mut t Table) find_or_register_array_with_dims(elem_type Type, nr_dims int) int {
|
||||
return if nr_dims == 1 {
|
||||
t.find_or_register_array(elem_type)
|
||||
} else {
|
||||
t.find_or_register_array(t.find_or_register_array_with_dims(elem_type, nr_dims - 1))
|
||||
if nr_dims == 1 {
|
||||
return t.find_or_register_array(elem_type)
|
||||
}
|
||||
return t.find_or_register_array(t.find_or_register_array_with_dims(elem_type, nr_dims - 1))
|
||||
}
|
||||
|
||||
pub fn (mut t Table) find_or_register_array_fixed(elem_type Type, size int) int {
|
||||
|
||||
Reference in New Issue
Block a user