示例#1
0
        public bool TryGet(ref Expression expr)
        {
            var        hash  = ExpressionHashVisitor.GetHash(expr);
            Expression cExpr = null;

            if (_cache.TryGetValue(hash, out cExpr))
            {
                expr = cExpr;
                Hits++;
                return(true);
            }
            Fails++;
            return(false);
        }
示例#2
0
        public void Add(Expression expr)
        {
            var hash = ExpressionHashVisitor.GetHash(expr);

            _cache[hash] = expr;
        }