예제 #1
0
 bool IEquatable <ITypeModifierSetEntry> .Equals(ITypeModifierSetEntry other)
 {
     if (other.Count != this.Count)
     {
         return(false);
     }
     return(((ITypeModifierSetEntry)this).EnumerateRequirementState().SequenceEqual(other.EnumerateRequirementState()) &&
            ((ITypeModifierSetEntry)this).EnumerateModifierTypes().SequenceEqual(other.EnumerateModifierTypes()));
 }
예제 #2
0
        public bool Equals(ITypeModifierSetEntry other)
        {
            if (other.Count != this.Count)
            {
                return(false);
            }
            return(((ITypeModifierSetEntry)this).EnumerateRequirementState().SequenceEqual(other.EnumerateRequirementState()) &&
                   ((ITypeModifierSetEntry)this).EnumerateModifierTypes().SequenceEqual(other.EnumerateModifierTypes()));

            return(this.SequenceEqual(other));

            //if (other == null)
            //    return false;
            //if (other.Count != this.Count)
            //    return false;

            //TypeModification  thisCurrent = default(TypeModification),
            //                 otherCurrent = default(TypeModification);
            //bool                 thisNext = false,
            //                    otherNext = false;
            //for (IEnumerator<TypeModification> thisEnum = this.GetEnumerator(), otherEnum = other.GetEnumerator(); (thisNext = thisEnum.MoveNext()) && (otherNext = otherEnum.MoveNext()); )
            //{
            //    thisCurrent = thisEnum.Current;
            //    otherCurrent = otherEnum.Current;
            //    if (!thisCurrent.Equals(otherCurrent))
            //        return false;
            //}
            ///* *
            // * The other entry's enumerator state machine
            // * yielded a different number of elements than is expected
            // * by the count specified.
            // * */
            //if (otherNext != thisNext)
            //    return false;
            //return true;
        }