Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Excess code generated for lambdas

$
0
0

I have the following line of code in my C# application:

ArgumentHelpers.ThrowIfNullOrWhitespace(() => args[0]);

JustDecompile shows the following decompilation:

ArgumentHelpers.ThrowIfNullOrWhitespace(newExpression<Func<string>>[] { Expression.Lambda<Func<string>>(Expression.ArrayIndex(Expression.Field(Expression.Constant(variable, typeof(Program.<>c__DisplayClass0_0)), FieldInfo.GetFieldFromHandle(typeof(Program.<>c__DisplayClass0_0).GetField("args").FieldHandle)), Expression.Constant(0, typeof(int))), newParameterExpression[0]) });

ILSpy shows the following decompilation:

ArgumentHelpers.ThrowIfNullOrWhitespace(newExpression<Func<string>>[]<br>{<br>    () => args[0]<br>});

It would be nice if JustDecompile generated the more concise syntax.


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>