From 7c893895d86e37f04210d13d3acc071414de8f82 Mon Sep 17 00:00:00 2001 From: yuyi Date: Thu, 4 Mar 2021 18:50:18 +0800 Subject: [PATCH] cgen: minor cleanup in infix_expr() (#9086) --- vlib/v/gen/c/cgen.v | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index 8138fe306b..cc100aad46 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -3028,16 +3028,13 @@ fn (mut g Gen) enum_expr(node ast.Expr) { } fn (mut g Gen) infix_expr(node ast.InfixExpr) { - // println('infix_expr() op="$node.op.str()" line_nr=$node.pos.line_nr') - // g.write('/*infix*/') - // if it.left_type == table.string_type_idx { - // g.write('/*$node.left_type str*/') - // } - // string + string, string == string etc - // g.infix_op = node.op if node.auto_locked != '' { g.writeln('sync__RwMutex_lock(&$node.auto_locked->mtx);') } + if node.op in [.key_is, .not_is] { + g.is_expr(node) + return + } left_type := g.unwrap_generic(node.left_type) left_sym := g.table.get_type_symbol(left_type) left_final_sym := g.table.get_final_type_symbol(left_type) @@ -3046,11 +3043,6 @@ fn (mut g Gen) infix_expr(node ast.InfixExpr) { } else { left_type } - op_is_key_is_or_not_is := node.op in [.key_is, .not_is] - if op_is_key_is_or_not_is { - g.is_expr(node) - return - } op_is_key_in_or_not_in := node.op in [.key_in, .not_in] op_is_eq_or_ne := node.op in [.eq, .ne] right_sym := g.table.get_type_symbol(node.right_type)