From 2db53a4bf00ab5c22369297c136d8e9a496dc5a3 Mon Sep 17 00:00:00 2001 From: yuyi Date: Fri, 27 Sep 2024 16:48:52 +0800 Subject: [PATCH] cgen: cleanup in gen_array_insert()/gen_array_prepend() (#22325) --- vlib/v/gen/c/array.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/v/gen/c/array.v b/vlib/v/gen/c/array.v index 8dce0e22c55882..dffb83faf822f0 100644 --- a/vlib/v/gen/c/array.v +++ b/vlib/v/gen/c/array.v @@ -879,7 +879,7 @@ fn (mut g Gen) gen_array_insert(node ast.CallExpr) { elem_type_str := g.typ(left_info.elem_type) arg2_sym := g.table.final_sym(node.args[1].typ) is_arg2_array := arg2_sym.kind == .array - && node.args[1].typ.clear_flag(.variadic) in [node.left_type, g.table.unaliased_type(node.left_type)] + && g.table.unaliased_type(node.args[1].typ.clear_flag(.variadic)) == g.table.unaliased_type(node.left_type) noscan := g.check_noscan(left_info.elem_type) addr := if node.left_type.is_ptr() { '' } else { '&' } if is_arg2_array { @@ -916,7 +916,7 @@ fn (mut g Gen) gen_array_prepend(node ast.CallExpr) { elem_type_str := g.typ(left_info.elem_type) arg_sym := g.table.final_sym(node.args[0].typ) is_arg_array := arg_sym.kind == .array - && node.args[0].typ in [node.left_type, g.table.unaliased_type(node.left_type)] + && g.table.unaliased_type(node.args[0].typ) == g.table.unaliased_type(node.left_type) noscan := g.check_noscan(left_info.elem_type) addr := if node.left_type.is_ptr() { '' } else { '&' } if is_arg_array {