Skip to content

Commit

Permalink
Optimized ArgumentNullException exception message.
Browse files Browse the repository at this point in the history
Should lead to less code size bloat due to unnecessarily unique strings.
  • Loading branch information
tritao committed Feb 29, 2016
1 parent 3dc9159 commit 2ed0565
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Generator/Generators/CLI/CLIMarshal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ private void MarshalRefClass(Class @class)
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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Generator/Generators/CSharp/CSharpMarshal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ private void MarshalRefClass(Class @class)
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);
Expand Down

0 comments on commit 2ed0565

Please sign in to comment.