Tup.Cobar4Net.Parser.Ast.Expression.Primary.Identifier.GetHashCode C# (CSharp) Method

GetHashCode() private method

private GetHashCode ( ) : int
return int
        public override int GetHashCode()
        {
            var constant = 37;
            var hash = 17;
            if (parent == null)
            {
                hash += constant;
            }
            else
            {
                hash = hash*constant + parent.GetHashCode();
            }
            if (idText == null)
            {
                hash += constant;
            }
            else
            {
                hash = hash*constant + idText.GetHashCode();
            }
            return hash;
        }

Usage Example

Esempio n. 1
0
        public override int GetHashCode()
        {
            var constant = 37;
            var hash     = 17;

            if (parent == null)
            {
                hash += constant;
            }
            else
            {
                hash = hash * constant + parent.GetHashCode();
            }
            if (idText == null)
            {
                hash += constant;
            }
            else
            {
                hash = hash * constant + idText.GetHashCode();
            }
            return(hash);
        }