GetHashCode() public method

public GetHashCode ( ) : int
return int
Esempio n. 1
0
        /// <summary>
        /// Calculate hash code of SegmentInfos
        /// </summary>
        /// <returns>hash code as in java version of ArrayList</returns>
        public override int GetHashCode()
        {
            int h = 1;

            for (int i = 0; i < this.Count; i++)
            {
                SegmentInfo si = (this[i] as SegmentInfo);
                h = 31 * h + (si == null ? 0 : si.GetHashCode());
            }

            return(h);
        }