Пример #1
0
        public ulong GetHash()
        {
            ulong hashCode = DTokens.Is;

            unchecked
            {
                if (TestedType != null)
                {
                    hashCode += 1000000007 * TestedType.GetHash();
                }
                hashCode += 1000000009 * (ulong)TypeAliasIdentifierHash;
                if (ptp != null)                //TODO: Create hash functions of template type parameters
                {
                    hashCode += 1000000021 * (ulong)ptp.ToString().GetHashCode();
                }
                hashCode += 1000000033uL * (EqualityTest ? 2uL : 1uL);
                if (TypeSpecialization != null)
                {
                    hashCode += 1000000087 * TypeSpecialization.GetHash();
                }
                hashCode += 1000000093 * (ulong)TypeSpecializationToken;
                if (TemplateParameterList != null)
                {
                    for (int i = TemplateParameterList.Length; i != 0;)
                    {
                        hashCode += 1000000097 * (ulong)(i * TemplateParameterList[--i].ToString().GetHashCode());
                    }
                }
            }
            return(hashCode);
        }
Пример #2
0
 public ulong GetHash()
 {
     unchecked
     {
         if (Declaration != null)
         {
             return(1000000007 * Declaration.GetHash());
         }
     }
     return(0);
 }
Пример #3
0
        public ulong GetHash()
        {
            ulong hashCode = 0uL;

            unchecked
            {
                if (Type != null)
                {
                    hashCode += 1000000007 * Type.GetHash();
                }
                if (AssignExpression != null)
                {
                    hashCode += 1000000009 * AssignExpression.GetHash();
                }
            }
            return(hashCode);
        }
Пример #4
0
        public ulong GetHash()
        {
            ulong hashCode = DTokens.Typeid;

            unchecked
            {
                if (Type != null)
                {
                    hashCode += 1000000007 * Type.GetHash();
                }
                if (Expression != null)
                {
                    hashCode += 1000000009 * Expression.GetHash();
                }
            }
            return(hashCode);
        }
        public override ulong GetHash()
        {
            ulong hashCode = 0uL;

            unchecked
            {
                if (Identifier != null)
                {
                    hashCode += 1000000007 * Identifier.GetHash();
                }
                hashCode += (ulong)TemplateIdHash;
                if (Arguments != null)
                {
                    for (ulong i = (ulong)Arguments.Length; i != 0;)
                    {
                        hashCode += 1000000009 * i * Arguments[(int)--i].GetHash();
                    }
                }
            }
            return(hashCode);
        }