[vala/staging] codegen: Don't re-evaluate "itype" when "deleg" variable is already available



commit af00f2da631b5e912e49ec6c3c01e98afc2826d6
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Mar 8 10:41:16 2020 +0100

    codegen: Don't re-evaluate "itype" when "deleg" variable is already available

 codegen/valaccodemethodcallmodule.vala | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index 2413bc99a..157b94bce 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -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


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