From 953d38321f817dffe18261ce77d508947ed4b4fb Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Wed, 6 Jul 2016 22:37:53 -0700 Subject: [PATCH] Avoid box allocation in TypeBuilder.DefineDataHelper (#6148) The current implementation calls `string.Concat(object, object)`, which results in a box allocation. Avoid the box allocation by calling `int.ToString()`, allowing `string.Concat(string, string)` to be used. --- src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs index 9861bcb1d4..161de3508c 100644 --- a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs @@ -852,7 +852,7 @@ namespace System.Reflection.Emit { ThrowIfCreated(); // form the value class name - strValueClassName = ModuleBuilderData.MULTI_BYTE_VALUE_CLASS + size; + strValueClassName = ModuleBuilderData.MULTI_BYTE_VALUE_CLASS + size.ToString(); // Is this already defined in this module? Type temp = m_module.FindTypeBuilderWithName(strValueClassName, false); -- 2.34.1