mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: optimize the format of the generated code
This commit is contained in:
parent
930c3d73c1
commit
947e8922f2
@ -4334,7 +4334,9 @@ fn (mut g Gen) array_init(it ast.ArrayInit) {
|
||||
}
|
||||
len := it.exprs.len
|
||||
g.write('new_array_from_c_array($len, $len, sizeof($elem_type_str), _MOV(($elem_type_str[$len]){')
|
||||
if len > 8 {
|
||||
g.writeln('')
|
||||
}
|
||||
for i, expr in it.exprs {
|
||||
if it.is_interface {
|
||||
// sym := g.table.get_type_symbol(it.interface_types[i])
|
||||
@ -4345,9 +4347,13 @@ fn (mut g Gen) array_init(it ast.ArrayInit) {
|
||||
if it.is_interface {
|
||||
g.write(')')
|
||||
}
|
||||
if i != len - 1 {
|
||||
g.write(', ')
|
||||
}
|
||||
}
|
||||
if len > 8 {
|
||||
g.writeln('')
|
||||
}
|
||||
g.write('}))')
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user