InternalGetHashCode() static private method

static private InternalGetHashCode ( byte internalData ) : int
internalData byte
return int
Beispiel #1
0
        public override int GetHashCode()
        {
            if (RefVal == null || RefVal == FalseTag)
            {
                return(0);
            }

            if (RefVal == TrueTag)
            {
                return(1);
            }

            if (RefVal == NumTypeTag)
            {
                return(GetHashCode(NumVal));
            }

            var asStr = RefVal as byte[];

            if (asStr != null)
            {
                return(LString.InternalGetHashCode(asStr));
            }

            var val = RefVal;

            var asWrapper = val as UserDataWrapper;

            if (asWrapper != null)
            {
                val = asWrapper.Value;
            }

            return(GetHashCode(val));
        }
Beispiel #2
0
        public override int GetHashCode()
        {
            if (Val == null || Val == Value.FalseTag)
            {
                return(0);
            }

            if (Val == Value.TrueTag)
            {
                return(1);
            }

            var asNum = Val as NumBox;

            if (asNum != null)
            {
                return(Value.GetHashCode(asNum.Value));
            }

            var asStr = Val as byte[];

            if (asStr != null)
            {
                return(LString.InternalGetHashCode(asStr));
            }

            var val = Val;

            var asWrapper = val as Value.UserDataWrapper;

            if (asWrapper != null)
            {
                val = asWrapper.Value;
            }

            return(Value.GetHashCode(val));
        }