override public bool Equals(object other) { if (other == this) { return(true); } List rhs = other as List; if (null == rhs) { return(false); } if (_count != rhs.Count) { return(false); } for (int i = 0; i < _count; ++i) { if (!RuntimeServices.EqualityOperator(_items[i], rhs[i])) { return(false); } } return(true); }
public bool Equals(Hash other) { if (null == other) { return(false); } if (this == other) { return(true); } if (Count != other.Count) { return(false); } foreach (DictionaryEntry entry in other) { if (!ContainsKey(entry.Key)) { return(false); } if (!RuntimeServices.EqualityOperator(entry.Value, this[entry.Key])) { return(false); } } return(true); }
public bool Equals(List <T> other) { if (other == null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } if (_count != other.Count) { return(false); } for (var i = 0; i < _count; ++i) { if (!RuntimeServices.EqualityOperator(_items[i], other[i])) { return(false); } } return(true); }
public bool Equals(Hash other) { if (other == null) { return(false); } if (ReferenceEquals(other, this)) { return(true); } if (Count != other.Count) { return(false); } foreach (var entry in other) { if (!ContainsKey(entry.Key)) { return(false); } if (!RuntimeServices.EqualityOperator(entry.Value, this[entry.Key])) { return(false); } } return(true); }
public override bool Equals(object obj) { if (this == obj) { return(true); } if (obj == null) { return(false); } if (GetType() != obj.GetType()) { return(false); } Hash other = (Hash)obj; if (Count != other.Count) { return(false); } foreach (DictionaryEntry entry in other) { if (!ContainsKey(entry.Key)) { return(false); } if (!RuntimeServices.EqualityOperator(entry.Value, this[entry.Key])) { return(false); } } return(true); }
public int IndexOf(object item) { for (int i = 0; i < _count; ++i) { if (RuntimeServices.EqualityOperator(_items[i], item)) { return(i); } } return(-1); }
public bool Equals(List <T> other) { if (null == other) { return(false); } if (this == other) { return(true); } if (_count != other.Count) { return(false); } for (int i = 0; i < _count; ++i) { if (!RuntimeServices.EqualityOperator(_items[i], other[i])) { return(false); } } return(true); }