Exemple #1
0
 /// <summary>
 ///     Returns a hash code for this instance.
 /// </summary>
 /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>
 public override int GetHashCode()
 {
     unchecked
     {
         return((LowAddress.GetHashCode() * 397) ^ HighAddress.GetHashCode());
     }
 }
Exemple #2
0
        /// <summary>
        ///     Compares to.
        /// </summary>
        /// <param name="other">The other.</param>
        /// <returns>System.Int32.</returns>
        public int CompareTo(MemoryRange other)
        {
            if (ReferenceEquals(this, other))
            {
                return(0);
            }
            if (ReferenceEquals(null, other))
            {
                return(1);
            }
            var lowComparison = LowAddress.CompareTo(other.LowAddress);

            if (lowComparison != 0)
            {
                return(lowComparison);
            }
            return(HighAddress.CompareTo(other.HighAddress));
        }