]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Don't re-evaluate "itype" when "deleg" variable is already available
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 8 Mar 2020 09:41:16 +0000 (10:41 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 8 Mar 2020 09:41:16 +0000 (10:41 +0100)
codegen/valaccodemethodcallmodule.vala

index 2413bc99a27705fa8b2f8a23886c6a874f90cc3d..157b94bce1b0e3a09bc9962cb9e4fed1e0206fbb 100644 (file)
@@ -670,14 +670,10 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                        }
                }
 
-               if (itype is DelegateType) {
-                       var deleg_type = (DelegateType) itype;
-                       var d = deleg_type.delegate_symbol;
-                       if (d.has_target) {
-                               CCodeExpression delegate_target_destroy_notify;
-                               in_arg_map.set (get_param_pos (get_ccode_instance_pos (d)), get_delegate_target_cexpression (expr.call, out delegate_target_destroy_notify));
-                               out_arg_map.set (get_param_pos (get_ccode_instance_pos (d)), get_delegate_target_cexpression (expr.call, out delegate_target_destroy_notify));
-                       }
+               if (deleg != null && deleg.has_target) {
+                       CCodeExpression delegate_target_destroy_notify;
+                       in_arg_map.set (get_param_pos (get_ccode_instance_pos (deleg)), get_delegate_target_cexpression (expr.call, out delegate_target_destroy_notify));
+                       out_arg_map.set (get_param_pos (get_ccode_instance_pos (deleg)), get_delegate_target_cexpression (expr.call, out delegate_target_destroy_notify));
                }
 
                // structs are returned via out parameter