[vala/0.50] codegen: Reduce get_delegate_target/get_delegate_target_destroy_notify calls
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.50] codegen: Reduce get_delegate_target/get_delegate_target_destroy_notify calls
- Date: Mon, 19 Oct 2020 20:16:41 +0000 (UTC)
commit c210de1211e54562a4d8bcd6787860aa42e289e3
Author: Jeremy Philippe <jeremy philippe gmail com>
Date: Wed Oct 7 13:41:40 2020 +0200
codegen: Reduce get_delegate_target/get_delegate_target_destroy_notify calls
codegen/valaccodebasemodule.vala | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index dfbae93b4..b11992e17 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5389,13 +5389,15 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
set_cvalue (expr, new CCodeCastExpression (innercexpr, get_ccode_name (expr.type_reference)));
if (expr.type_reference is DelegateType) {
- if (get_delegate_target (expr.inner) != null) {
- set_delegate_target (expr, get_delegate_target (expr.inner));
+ var target = get_delegate_target (expr.inner);
+ if (target != null) {
+ set_delegate_target (expr, target);
} else {
set_delegate_target (expr, new CCodeConstant ("NULL"));
}
- if (get_delegate_target_destroy_notify (expr.inner) != null) {
- set_delegate_target_destroy_notify (expr, get_delegate_target_destroy_notify
(expr.inner));
+ var target_destroy_notify = get_delegate_target_destroy_notify (expr.inner);
+ if (target_destroy_notify != null) {
+ set_delegate_target_destroy_notify (expr, target_destroy_notify);
} else {
set_delegate_target_destroy_notify (expr, new CCodeConstant ("NULL"));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]