GetHashCode() public method

public GetHashCode ( Object o ) : int
o Object
return int
コード例 #1
0
        public virtual int GetHashCode(object o) {
            string obj = o as string;
            if (obj == null) {
                return o.GetHashCode();
            }

            return BackCompatibleStringComparer.GetHashCode(obj);
        }
コード例 #2
0
        public virtual int GetHashCode(object o)
        {
            if (!(o is string obj))
            {
                return(o.GetHashCode());
            }

            return(BackCompatibleStringComparer.GetHashCode(obj));
        }