From bca0440b16a53a889381226bf77f7dd9d84917ee Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 23 Jun 2020 05:25:34 -0700 Subject: [PATCH] Improvements to variants --- BeefLibs/corlib/src/Reflection/MethodInfo.bf | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/BeefLibs/corlib/src/Reflection/MethodInfo.bf b/BeefLibs/corlib/src/Reflection/MethodInfo.bf index f549bbd7..5f9ff8f8 100644 --- a/BeefLibs/corlib/src/Reflection/MethodInfo.bf +++ b/BeefLibs/corlib/src/Reflection/MethodInfo.bf @@ -238,8 +238,7 @@ namespace System.Reflection if (args.Length != mMethodData.mParamCount) return .Err(.ParamCountMismatch); - Variant retVal; - void* variantData = Variant.Alloc(retType, out retVal); + var (retVal, variantData) = Variant.Alloc(retType); void* retData = variantData; // Struct return? Manually add it as an arg after 'this'. Revisit this - this is architecture-dependent. @@ -501,8 +500,7 @@ namespace System.Reflection if (args.Count != mMethodData.mParamCount) return .Err(.ParamCountMismatch); - Variant retVal; - void* variantData = Variant.Alloc(retType, out retVal); + var (retVal, variantData) = Variant.Alloc(retType); void* retData = variantData; // Struct return? Manually add it as an arg after 'this'. Revisit this - this is architecture-dependent.