示例#1
0
        public bool Equals(NTuple <T> other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (other == null)
            {
                return(false);
            }
            var length = Values.Length;

            if (length != other.Values.Length)
            {
                return(false);
            }
            for (var i = 0; i < length; ++i)
            {
                if (!Equals(Values[i], other.Values[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
示例#2
0
        public int CompareTo(NTuple <T> other)
        {
            if (ReferenceEquals(this, other))
            {
                return(0);
            }

            if (other == null)
            {
                return(-1);
            }
            var length = Values.Length;

            if (length != other.Values.Length)
            {
                return(-1);
            }
            int dif = String.Compare(this.Values[0].ToString(), other.Values[0].ToString());

            return(dif);
            //for (var i = 0; i < length; ++i)
            //	if (!Equals(Values[i], other.Values[i])) return false;
            //return true;
        }