public bool IsSatisfiedBy(Tuple leftTuple, Fact rightFact) { //todo: optimize IEnumerable <Fact> facts = _tupleMask.Select( idx => leftTuple.ElementAtOrDefault(idx) ?? rightFact); object[] factObjects = facts.Select(f => f.Object).ToArray(); return(IsSatisfiedBy(factObjects)); }
public void Invoke(IContext context, Tuple tuple) { //todo: optimize IEnumerable <Fact> facts = _tupleMask.Select( idx => tuple.ElementAtOrDefault(idx)); object[] args = Enumerable.Repeat(context, 1).Union(facts.Select(f => f.Object)).ToArray(); _compiledAction.DynamicInvoke(args); }