Browse Source

Added optimization for trailing assignment in .NET 3

4.0.0-beta
Anairkoen Schno 4 years ago
parent
commit
c97e1693c2
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      Net3-Proxy/ExpressionEx.cs

+ 4
- 1
Net3-Proxy/ExpressionEx.cs View File

@ -166,7 +166,10 @@ namespace Net3_Proxy
}
Expression topBody;
if (lastType != null)
if (rest.Count == 0)
topBody = info.Param;
else if (lastType != null)
{
var execSeq = ExecuteSequenceTyped.MakeGenericMethod(lastType);
topBody = Expression.Call(null, execSeq, last, Expression.NewArrayInit(typeof(Action), rest.Cast<Expression>()));


Loading…
Cancel
Save