[vala] Drop type check statements if assertions are disabled



commit 6fe24769967330532c273046f3dd55c01aa4f92d
Author: Thijs Vermeir <thijsvermeir gmail com>
Date:   Fri Apr 3 23:58:09 2009 +0200

    Drop type check statements if assertions are disabled
---
 gobject/valaccodebasemodule.vala |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gobject/valaccodebasemodule.vala b/gobject/valaccodebasemodule.vala
index 847ac91..2176477 100644
--- a/gobject/valaccodebasemodule.vala
+++ b/gobject/valaccodebasemodule.vala
@@ -3728,8 +3728,10 @@ internal class Vala.CCodeBaseModule : CCodeModule {
 
 	public CCodeStatement? create_type_check_statement (CodeNode method_node, DataType ret_type, TypeSymbol t, bool non_null, string var_name) {
 		var ccheck = new CCodeFunctionCall ();
-		
-		if (context.checking && ((t is Class && !((Class) t).is_compact) || t is Interface)) {
+
+		if (!context.assert) {
+			return null;
+		} else if (context.checking && ((t is Class && !((Class) t).is_compact) || t is Interface)) {
 			var ctype_check = new CCodeFunctionCall (new CCodeIdentifier (get_type_check_function (t)));
 			ctype_check.add_argument (new CCodeIdentifier (var_name));
 			



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