[vala/emit-let: 5/5] codegen: Drop useless comma expression in GType module
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/emit-let: 5/5] codegen: Drop useless comma expression in GType module
- Date: Thu, 3 Mar 2011 18:57:15 +0000 (UTC)
commit c44a9cb36d15fb0c45d70f8cb35d8b389b5d27c7
Author: Luca Bruno <lucabru src gnome org>
Date: Thu Mar 3 19:47:40 2011 +0100
codegen: Drop useless comma expression in GType module
codegen/valagtypemodule.vala | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index fc77780..5dde7d3 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -2100,7 +2100,6 @@ public class Vala.GTypeModule : GErrorModule {
}
// to_string() on a gtype enum
- var ccomma = new CCodeCommaExpression ();
var temp_var = get_temp_variable (new CType ("GEnumValue*"), false, expr, false);
emit_temp_var (temp_var);
@@ -2110,10 +2109,9 @@ public class Vala.GTypeModule : GErrorModule {
get_value.add_argument (class_ref);
get_value.add_argument ((CCodeExpression) get_ccodenode (((MemberAccess) expr.call).inner));
- ccomma.append_expression (new CCodeAssignment (get_variable_cexpression (temp_var.name), get_value));
+ ccode.add_assignment (get_variable_cexpression (temp_var.name), get_value);
var is_null_value = new CCodeBinaryExpression (CCodeBinaryOperator.INEQUALITY, get_variable_cexpression (temp_var.name), new CCodeIdentifier ("NULL"));
- ccomma.append_expression (new CCodeConditionalExpression (is_null_value, new CCodeMemberAccess.pointer (get_variable_cexpression (temp_var.name), "value_name"), new CCodeIdentifier ("NULL")));
- set_cvalue (expr, ccomma);
+ set_cvalue (expr, new CCodeConditionalExpression (is_null_value, new CCodeMemberAccess.pointer (get_variable_cexpression (temp_var.name), "value_name"), new CCodeIdentifier ("NULL")));
}
public override void visit_property (Property prop) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]