bool System.Collections.IStructuralEquatable.Equals(object other, System.Collections.IEqualityComparer comparer) { if (object.ReferenceEquals(this, other)) { return(true); } if (other == null) { return(false); } var linked = other as FdbLinkedTuple <T>; if (!object.ReferenceEquals(linked, null)) { // must have same length if (linked.Count != this.Count) { return(false); } // compare the tail before if (!comparer.Equals(this.Tail, linked.Tail)) { return(false); } // compare the rest return(this.Head.Equals(linked.Tail, comparer)); } return(FdbTuple.Equals(this, other, comparer)); }
bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer) { if (object.ReferenceEquals(this, other)) { return(true); } if (other == null) { return(false); } var sliced = other as FdbSlicedTuple; if (!object.ReferenceEquals(sliced, null)) { if (sliced.m_count != m_count) { return(false); } // compare slices! for (int i = 0; i < m_count; i++) { if (m_slices[i + m_offset] != sliced.m_slices[i + sliced.m_offset]) { return(false); } } return(false); } return(FdbTuple.Equals(this, other, comparer)); }
bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer) { if (object.ReferenceEquals(this, other)) { return(true); } if (other == null) { return(false); } var list = other as FdbListTuple; if (!object.ReferenceEquals(list, null)) { if (list.m_count != m_count) { return(false); } if (list.m_offset == 0 && list.m_count == list.m_items.Length) { return(CompareItems(list.m_items, comparer)); } else { return(CompareItems(list, comparer)); } } return(FdbTuple.Equals(this, other, comparer)); }
bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer) { if (other == null) { return(false); } if (other is FdbTuple <T1> ) { return(comparer.Equals(this.Item1, ((FdbTuple <T1>)other).Item1)); } return(FdbTuple.Equals(this, other, comparer)); }
bool System.Collections.IStructuralEquatable.Equals(object other, System.Collections.IEqualityComparer comparer) { if (other == null) { return(false); } if (other is FdbTuple <T1, T2> ) { var tuple = (FdbTuple <T1, T2>)other; return(comparer.Equals(this.Item1, tuple.Item1) && comparer.Equals(this.Item2, tuple.Item2)); } return(FdbTuple.Equals(this, other, comparer)); }
bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer) { if (other == null) { return(false); } if (other is FdbTuple <T1, T2, T3> ) { var tuple = (FdbTuple <T1, T2, T3>)other; return(comparer.Equals(this.Item1, tuple.Item1) && comparer.Equals(this.Item2, tuple.Item2) && comparer.Equals(this.Item3, tuple.Item3)); } return(FdbTuple.Equals(this, other, comparer)); }
public bool Equals(IFdbTuple other) { if (object.ReferenceEquals(other, null)) { return(false); } var memoized = other as FdbMemoizedTuple; if (!object.ReferenceEquals(memoized, null)) { return(m_packed.Equals(memoized.m_packed)); } return(FdbTuple.Equals(this, other, SimilarValueComparer.Default)); }
bool System.Collections.IStructuralEquatable.Equals(object other, System.Collections.IEqualityComparer comparer) { if (object.ReferenceEquals(this, other)) { return(true); } if (other == null) { return(false); } var linked = other as FdbPrefixedTuple; if (!object.ReferenceEquals(linked, null)) { // Should all of these tuples be considered equal ? // * Head=(A,B) + Tail=(C,) // * Head=(A,) + Tail=(B,C,) // * Head=() + Tail=(A,B,C,) // first check the subspaces if (!linked.m_prefix.Equals(m_prefix)) { // they have a different prefix return(false); } if (m_items.Count != linked.m_items.Count) { // there's no way they would be equal return(false); } return(comparer.Equals(m_items, linked.m_items)); } return(FdbTuple.Equals(this, other, comparer)); }
bool IStructuralEquatable.Equals(object other, System.Collections.IEqualityComparer comparer) { return(FdbTuple.Equals(this, other, comparer)); }