]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Drop type check statements if assertions are disabled
authorThijs Vermeir <thijsvermeir@gmail.com>
Fri, 3 Apr 2009 21:58:09 +0000 (23:58 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 3 Apr 2009 21:58:09 +0000 (23:58 +0200)
gobject/valaccodebasemodule.vala

index 847ac91f82104aec6cab083dace202065a0c09c2..2176477ff1372ee5c9fff26a2574b0d4fd6918b0 100644 (file)
@@ -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));