mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: optimize gen c code format
This commit is contained in:
parent
5e2a6ffe65
commit
ffafeac0f8
@ -2240,7 +2240,7 @@ fn (mut g Gen) index_expr(node ast.IndexExpr) {
|
||||
}
|
||||
*/
|
||||
if need_wrapper {
|
||||
g.write(', &($elem_type_str[]) { \n')
|
||||
g.write(', &($elem_type_str[]) { ')
|
||||
} else {
|
||||
g.write(', &')
|
||||
}
|
||||
@ -2292,7 +2292,7 @@ fn (mut g Gen) index_expr(node ast.IndexExpr) {
|
||||
g.expr(node.left)
|
||||
g.write(', ')
|
||||
g.expr(node.index)
|
||||
g.write(', &($elem_type_str[]) { \n')
|
||||
g.write(', &($elem_type_str[]) { ')
|
||||
} else {
|
||||
/*
|
||||
g.write('(*($elem_type_str*)map_get2(')
|
||||
|
@ -252,7 +252,13 @@ fn (mut g Gen) gen_fn_decl(it ast.FnDecl) {
|
||||
if g.pref.is_prof {
|
||||
g.profile_fn(it.name, is_main)
|
||||
}
|
||||
if is_main {
|
||||
g.indent++
|
||||
}
|
||||
g.stmts(it.stmts)
|
||||
if is_main {
|
||||
g.indent--
|
||||
}
|
||||
// ////////////
|
||||
if is_main {
|
||||
if g.autofree {
|
||||
|
Loading…
Reference in New Issue
Block a user