Beispiel #1
0
        public new static bool Equals(Object obj1, Object obj2)
        {
            if (obj1 == obj2)
            {
                return(true);
            }

            if ((obj1 == null) || (obj2 == null))
            {
                return(false);
            }

            // If it's not a value class, don't compare by value
            if (!obj1.EETypePtr.IsValueType)
            {
                return(false);
            }

            // Make sure they are the same type.
            if (obj1.EETypePtr != obj2.EETypePtr)
            {
                return(false);
            }

            return(RuntimeImports.RhCompareObjectContentsAndPadding(obj1, obj2));
        }
Beispiel #2
0
        public static new bool Equals(object?o1, object?o2)
        {
            if (o1 == o2)
            {
                return(true);
            }

            if ((o1 == null) || (o2 == null))
            {
                return(false);
            }

            // If it's not a value class, don't compare by value
            if (!o1.GetEETypePtr().IsValueType)
            {
                return(false);
            }

            // Make sure they are the same type.
            if (o1.GetEETypePtr() != o2.GetEETypePtr())
            {
                return(false);
            }

            return(RuntimeImports.RhCompareObjectContentsAndPadding(o1, o2));
        }