XSpect.Yacq.Expressions.YacqExpression.ReduceOnce C# (CSharp) Method

ReduceOnce() public method

Reduces this node to a simpler expression with additional symbol tables. This method can return another node which itself must be reduced.
public ReduceOnce ( SymbolTable symbols = null, Type expectedType = null ) : Expression
symbols XSpect.Yacq.Symbols.SymbolTable The additional symbol table for reducing.
expectedType System.Type The type which is expected as the type of reduced expression.
return System.Linq.Expressions.Expression
        public Expression ReduceOnce(SymbolTable symbols = null, Type expectedType = null)
        {
            symbols = this.CreateSymbolTable(symbols);
            var hash = symbols.AllHash
                ^ (expectedType != null ? expectedType.GetHashCode() : 0);
            return this._reducedExpressions.GetValue(hash)
                ?? (this.ReduceImpl(symbols, expectedType) ?? this)
                       .If(e => e != this && !(e is YacqExpression), e =>
                           ImplicitConvert(e, expectedType)
                       )
                       .If(e => e != this, e =>
                           this._reducedExpressions[hash] = e
                       );
        }