translate-c: avoid array concatenation if the init node is empty, for clarity.

master
Sahnvour 2019-01-26 16:47:11 +01:00
parent 584cb1fcfe
commit f0d35d78b6
1 changed files with 4 additions and 0 deletions

View File

@ -4117,6 +4117,10 @@ static AstNode *trans_ap_value(Context *c, APValue *ap_value, QualType qt, const
rhs_node = trans_create_node_bin_op(c, filler_arr_1, BinOpTypeArrayMult, amt_node); rhs_node = trans_create_node_bin_op(c, filler_arr_1, BinOpTypeArrayMult, amt_node);
} }
if (init_count == 0) {
return rhs_node;
}
return trans_create_node_bin_op(c, init_node, BinOpTypeArrayCat, rhs_node); return trans_create_node_bin_op(c, init_node, BinOpTypeArrayCat, rhs_node);
} }
case APValue::LValue: { case APValue::LValue: {