mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: simplify slicing fixed array (#13767)
This commit is contained in:
parent
bb2ddb98a3
commit
f903ef24e8
@ -115,17 +115,8 @@ fn (mut g Gen) range_expr(node ast.IndexExpr, range ast.RangeExpr) {
|
||||
g.write('array_slice(')
|
||||
}
|
||||
g.write('new_array_from_c_array${noscan}(')
|
||||
g.write('$info.size')
|
||||
g.write(', $info.size')
|
||||
g.write(', sizeof(')
|
||||
if node.left_type.is_ptr() {
|
||||
g.write('(*')
|
||||
}
|
||||
g.expr(node.left)
|
||||
if node.left_type.is_ptr() {
|
||||
g.write(')')
|
||||
}
|
||||
g.write('[0]), ')
|
||||
ctype := g.typ(info.elem_type)
|
||||
g.write('$info.size, $info.size, sizeof($ctype), ')
|
||||
if node.left_type.is_ptr() {
|
||||
g.write('*')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user