Ejemplo n.º 1
0
 public bool Equals(MultiKey <T1, T2> x, MultiKey <T1, T2> y)
 {
     if (comparer1.Equals(x.value1, y.value1))
     {
         return(comparer2.Equals(x.value2, y.value2));
     }
     return(false);
 }
Ejemplo n.º 2
0
                internal override bool TryCreateKeyFromValues(object[] values, out MultiKey <V1, V2> k)
                {
                    var obj = values[offset];

                    if (obj == null && typeof(V1).IsValueType)
                    {
                        k = default(MultiKey <V1, V2>);
                        return(false);
                    }
                    if (!next.TryCreateKeyFromValues(values, out var k2))
                    {
                        k = default(MultiKey <V1, V2>);
                        return(false);
                    }
                    k = new MultiKey <V1, V2>((V1)obj, k2);
                    return(true);
                }
Ejemplo n.º 3
0
                internal override bool TryCreateKeyFromValues(object[] values, out MultiKey <V1, V2> k)
                {
                    System.Diagnostics.Debug.Assert(this.offset < values.Length, "offset is outside the bounds of the values array");

                    object o = values[this.offset];

                    if (o == null && typeof(V1).IsValueType)
                    {
                        k = default(MultiKey <V1, V2>);
                        return(false);
                    }
                    V2 v2;

                    if (!this.next.TryCreateKeyFromValues(values, out v2))
                    {
                        k = default(MultiKey <V1, V2>);
                        return(false);
                    }
                    k = new MultiKey <V1, V2>((V1)o, v2);
                    return(true);
                }
Ejemplo n.º 4
0
 public int GetHashCode(MultiKey <T1, T2> x) => comparer1.GetHashCode(x.value1) ^ comparer2.GetHashCode(x.value2);
Ejemplo n.º 5
0
 public int GetHashCode(MultiKey <T1, T2> x)
 {
     return(this.comparer1.GetHashCode(x.value1) ^ this.comparer2.GetHashCode(x.value2));
 }
Ejemplo n.º 6
0
 public bool Equals(MultiKey <T1, T2> x, MultiKey <T1, T2> y)
 {
     return(this.comparer1.Equals(x.value1, y.value1) &&
            this.comparer2.Equals(x.value2, y.value2));
 }