Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 8 Update(7): Throw Exception Helper functions #1733

Closed

Conversation

pCYSl5EDgo
Copy link
Contributor

Aggressive Inlining is suppressed in function which has throw statement.
Such a ArgumentNullException.ThrowIfNull function helps inlining.

@pCYSl5EDgo pCYSl5EDgo mentioned this pull request Jan 11, 2024
14 tasks
@@ -11,10 +11,14 @@ internal static class ExpressionUtility
{
private static MethodInfo GetMethodInfoCore(LambdaExpression expression)
{
#if NET6_0_OR_GREATER
ArgumentNullException.ThrowIfNull(expression, nameof(expression));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want a bunch of #if statements for something so trivially addressible in another way. Just create an internal static helper class that has the if and throw check inside it, and use that in all the places you've changed here so we can do without the #if/#else blocks.

@pCYSl5EDgo
Copy link
Contributor Author

pCYSl5EDgo commented Jan 15, 2024

I keep my hands off this PR until #1734 will be completed since ThrowHelper.cs's appropriate path is unclear.

@pCYSl5EDgo pCYSl5EDgo closed this Jan 15, 2024
@pCYSl5EDgo pCYSl5EDgo changed the title .Net 8 Update(7): Throw Exception Helper functions .NET 8 Update(7): Throw Exception Helper functions Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants