System.Int32.GetHashCode C# (CSharp) Method

GetHashCode() public method

public GetHashCode ( ) : int
return int
        public override int GetHashCode()
        {
            return _value;
        }

Usage Example

示例#1
0
        public override int GetHashCode()
        {
            int hash = ((System.Int32)refLevel).GetHashCode();

            for (int i = 0; i < size(); i++)
            {
                //NOTE(ctsims): It looks like this is only using Integer to
                //get the hashcode method, but that method
                //is just returning the int value, I think, so
                //this should potentially just be replaced by
                //an int.
                System.Int32 mult = DataUtil.integer(getMultiplicity(i));
                if (i == 0 && mult == INDEX_UNBOUND)
                {
                    mult = DataUtil.integer(0);
                }

                hash ^= getName(i).GetHashCode();
                hash ^= mult.GetHashCode();

                if (predicates == null)
                {
                    continue;
                }
                int val = 0;

                for (XPathExpression xpe: predicates)
                {
                    hash ^= val;
                    hash ^= xpe.hashCode();
                    ++val;
                }
            }
            return(hash);
        }
All Usage Examples Of System.Int32::GetHashCode