System.Linq.Expressions.UnaryExpression.ReduceVariable C# (CSharp) 메소드

ReduceVariable() 개인적인 메소드

private ReduceVariable ( ) : Expression
리턴 Expression
        private Expression ReduceVariable()
        {
            if (IsPrefix)
            {
                // (op) var
                // ... is reduced into ...
                // var = op(var)
                return Assign(Operand, FunctionalOp(Operand));
            }
            // var (op)
            // ... is reduced into ...
            // temp = var
            // var = op(var)
            // temp
            ParameterExpression temp = Parameter(Operand.Type, name: null);
            return Block(
                new  TrueReadOnlyCollection<ParameterExpression>(temp),
                new TrueReadOnlyCollection<Expression>(
                    Assign(temp, Operand),
                    Assign(Operand, FunctionalOp(temp)),
                    temp
                )
            );
        }