From: Thijs Vermeir Date: Fri, 3 Apr 2009 21:58:09 +0000 (+0200) Subject: Drop type check statements if assertions are disabled X-Git-Tag: 0.7.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fe24769967330532c273046f3dd55c01aa4f92d;p=thirdparty%2Fvala.git Drop type check statements if assertions are disabled --- diff --git a/gobject/valaccodebasemodule.vala b/gobject/valaccodebasemodule.vala index 847ac91f8..2176477ff 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));