Skip to content

Commit

Permalink
cgen: cleanup verbose code in assign_stmt() (#19421)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 authored Sep 23, 2023
1 parent 83d4614 commit 1c9ab77
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions vlib/v/gen/c/assign.v
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ fn (mut g Gen) assign_stmt(node_ ast.AssignStmt) {
// Free the old value assigned to this string var (only if it's `str = [new value]`
// or `x.str = [new value]` )
mut af := g.is_autofree && !g.is_builtin_mod && node.op == .assign && node.left_types.len == 1
&& (node.left[0] is ast.Ident || node.left[0] is ast.SelectorExpr)
// node.left_types[0] in [ast.string_type, ast.array_type] &&
&& node.left[0] in [ast.Ident, ast.SelectorExpr]
mut sref_name := ''
mut type_to_free := ''
if af {
Expand Down

0 comments on commit 1c9ab77

Please sign in to comment.