[vala] codegen: Always copy struct on access only when it's non-nullable
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Always copy struct on access only when it's non-nullable
- Date: Tue, 16 Aug 2011 21:24:18 +0000 (UTC)
commit 1a49420d4b5eca305acdae4caef934e801439abe
Author: Luca Bruno <lucabru src gnome org>
Date: Tue Aug 16 22:36:05 2011 +0200
codegen: Always copy struct on access only when it's non-nullable
We currently don't copy the nullable struct, only the reference,
therefore useless.
codegen/valaccodememberaccessmodule.vala | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala
index 569e1dc..2978ce8 100644
--- a/codegen/valaccodememberaccessmodule.vala
+++ b/codegen/valaccodememberaccessmodule.vala
@@ -697,7 +697,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
if (variable is Parameter && variable.name == "this") {
use_temp = false;
}
- if (variable.single_assignment && !result.value_type.is_real_struct_type ()) {
+ if (variable.single_assignment && !result.value_type.is_real_non_null_struct_type ()) {
// no need to copy values from variables that are assigned exactly once
// as there is no risk of modification
// except for structs that are always passed by reference
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]