예제 #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;
        }