From 2ed0565d18c321e3d9b9a5c44c84723bf9140842 Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Mon, 29 Feb 2016 12:29:45 +0000 Subject: [PATCH] Optimized ArgumentNullException exception message. Should lead to less code size bloat due to unnecessarily unique strings. --- src/Generator/Generators/CLI/CLIMarshal.cs | 2 +- src/Generator/Generators/CSharp/CSharpMarshal.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Generator/Generators/CLI/CLIMarshal.cs b/src/Generator/Generators/CLI/CLIMarshal.cs index 5d54d878..76babc78 100644 --- a/src/Generator/Generators/CLI/CLIMarshal.cs +++ b/src/Generator/Generators/CLI/CLIMarshal.cs @@ -700,7 +700,7 @@ namespace CppSharp.Generators.CLI Context.SupportBefore.WriteLine("if (ReferenceEquals({0}, nullptr))", Context.Parameter.Name); Context.SupportBefore.WriteLineIndent( "throw gcnew ::System::ArgumentNullException(\"{0}\", " + - "\"{0} cannot be null because it is a C++ reference (&).\");", + "\"Cannot be null because it is a C++ reference (&).\");", Context.Parameter.Name); } diff --git a/src/Generator/Generators/CSharp/CSharpMarshal.cs b/src/Generator/Generators/CSharp/CSharpMarshal.cs index 9618b012..58b5533f 100644 --- a/src/Generator/Generators/CSharp/CSharpMarshal.cs +++ b/src/Generator/Generators/CSharp/CSharpMarshal.cs @@ -674,7 +674,7 @@ namespace CppSharp.Generators.CSharp Context.SupportBefore.WriteLine("if (ReferenceEquals({0}, null))", param); Context.SupportBefore.WriteLineIndent( "throw new global::System.ArgumentNullException(\"{0}\", " + - "\"{0} cannot be null because it is a C++ reference (&).\");", + "\"Cannot be null because it is a C++ reference (&).\");", param); } Context.Return.Write("{0}.{1}", param, Helpers.InstanceIdentifier);