Skip to content

Commit

Permalink
cgen: minor cleanup in struct_init() (#16676)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Dec 14, 2022
1 parent 8ab4c77 commit 8e3a90a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions vlib/v/gen/c/struct.v
Expand Up @@ -37,10 +37,8 @@ fn (mut g Gen) struct_init(node ast.StructInit) {
g.go_back(1) // delete the `&` already generated in `prefix_expr()
}
mut is_anon := false
if sym.kind == .struct_ {
mut info := sym.info as ast.Struct

is_anon = info.is_anon
if mut sym.info is ast.Struct {
is_anon = sym.info.is_anon
}

if !g.inside_cinit && !is_anon {
Expand Down

0 comments on commit 8e3a90a

Please sign in to comment.