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); }
public void Add(Expression expr) { var hash = ExpressionHashVisitor.GetHash(expr); _cache[hash] = expr; }