From: Luca Bruno Date: Tue, 16 Aug 2011 20:36:05 +0000 (+0200) Subject: codegen: Always copy struct on access only when it's non-nullable X-Git-Tag: 0.13.3~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1a49420d4b5eca305acdae4caef934e801439abe;p=thirdparty%2Fvala.git 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. --- diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala index 569e1dc0a..2978ce8cf 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