[vala/staging] vala: Prioritize the usage of an existing with-variable instance
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] vala: Prioritize the usage of an existing with-variable instance
- Date: Sun, 27 Sep 2020 09:11:20 +0000 (UTC)
commit b277482943639a1b4fa0bc8db7dd577b61d70042
Author: Nick Schrader <nick schrader mailbox org>
Date: Sat Sep 26 13:57:13 2020 +0200
vala: Prioritize the usage of an existing with-variable instance
vala/valawithstatement.vala | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/vala/valawithstatement.vala b/vala/valawithstatement.vala
index f873e600c..52210284a 100644
--- a/vala/valawithstatement.vala
+++ b/vala/valawithstatement.vala
@@ -105,10 +105,10 @@ public class Vala.WithStatement : Block {
var local_var = expression.symbol_reference as LocalVariable;
if (with_variable != null || local_var == null) {
- if (with_variable == null) {
- local_var = new LocalVariable (expression.value_type.copy (), get_temp_name
(), expression, source_reference);
- } else {
+ if (with_variable != null) {
local_var = with_variable;
+ } else {
+ local_var = new LocalVariable (expression.value_type.copy (), get_temp_name
(), expression, source_reference);
}
body.insert_statement (0, new DeclarationStatement (local_var, source_reference));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]