Esempio n. 1
0
        public override int GetHashCode()
        {
            int code = 23;

            code = code * 31 + _type.GetHashCode();
            code = code * 31 + (_leftEnv == null ? 0 : _leftEnv.GetFrozenHashCode());
            code = code * 31 + (_rightEnv == null ? 0 : _rightEnv.GetFrozenHashCode());
            return(code);
        }
        public override int GetHashCode()
        {
            int code = 23;

            code = code * 31 + _type.GetHashCode();
            code = code * 31 + _adjacency.GetHashCode();
            code = code * 31 + _others.GetSequenceHashCode();
            return(code);
        }
Esempio n. 3
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (ConstraintType != null)
         {
             hashCode = hashCode * 59 + ConstraintType.GetHashCode();
         }
         if (AdditionalValue != null)
         {
             hashCode = hashCode * 59 + AdditionalValue.GetHashCode();
         }
         return(hashCode);
     }
 }
        /// <summary>
        /// Computes a hash code for this object.
        /// </summary>
        /// <returns>
        /// Hash code.
        /// </returns>
        public override int GetHashCode()
        {
            unchecked
            {
                int result = 17;
                result = (result * 397) ^ m_Name.GetHashCode();
                result = (result * 397) ^ m_Type.GetHashCode();

                Table ParentTable = m_Parent;
                if (IsGhost && Twin != null)
                {
                    ParentTable = ((Constraint)Twin).Parent;
                }

                if (ParentTable != null)
                {
                    result = (result * 397) ^ ParentTable.GetHashCode();
                }

                return(result);
            }
        }