nhibernate/nhibernate-core — pull request #191 by DmitryNaumov (2013-01-26 21:20:09+00:00)
Title: Tuple equality

Late night and I have no access to SQL to re-run tests, but idea should be clear:

Let's make clear statement that Tuple can't have null Items and Items
can't change (as well as Tuple's hash code)

And do we still need this code?

private static LambdaExpression MakePredicate(int index)
{
// t => Not(ReferenceEquals(t.Items[index], null))
var t = Expression.Parameter(typeof(Tuple), "t");
return Expression.Lambda(
Expression.Not(
Expression.Call(typeof(object),
"ReferenceEquals",
System.Type.EmptyTypes,
Expression.ArrayIndex(
Expression.Property(t, Tuple.ItemsProperty),
Expression.Constant(index)),
Expression.Constant(null))),
t);
}