[vala] codegen: Do not add null-check for SimpleType structs



commit 098eff47cdbe20511436dc6b7f67b0f7a5c3c621
Author: Luca Bruno <lucabru src gnome org>
Date:   Tue Aug 30 09:51:02 2011 +0200

    codegen: Do not add null-check for SimpleType structs

 codegen/valagtypemodule.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index 273f6a1..d7621dc 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -2153,7 +2153,7 @@ public class Vala.GTypeModule : GErrorModule {
 				cexpr = new CCodeBinaryExpression (CCodeBinaryOperator.OR, cnull, ctype_check);
 			}
 			ccheck.add_argument (cexpr);
-		} else if (!non_null) {
+		} else if (!non_null || (t is Struct && ((Struct) t).is_simple_type ())) {
 			return;
 		} else if (t == glist_type || t == gslist_type) {
 			// NULL is empty list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]