Esempio n. 1
0
        //
        // Faster version of Equals for use on EETypes that are known not to be null and where the "match" case is the hot path.
        //
        public bool FastEquals(EETypePtr other)
        {
            Debug.Assert(!this.IsNull);
            Debug.Assert(!other.IsNull);

            // Fast check for raw equality before making call to helper.
            if (this.RawValue == other.RawValue)
            {
                return(true);
            }
            return(RuntimeImports.AreTypesEquivalent(this, other));
        }
Esempio n. 2
0
 public static bool operator ==(EETypePtr value1, EETypePtr value2)
 {
     if (value1.IsNull)
     {
         return(value2.IsNull);
     }
     else if (value2.IsNull)
     {
         return(false);
     }
     else
     {
         return(RuntimeImports.AreTypesEquivalent(value1, value2));
     }
 }
Esempio n. 3
0
 public bool Equals(RuntimeTypeHandle handle)
 {
     if (_value == handle._value)
     {
         return(true);
     }
     else if (this.IsNull || handle.IsNull)
     {
         return(false);
     }
     else
     {
         return(RuntimeImports.AreTypesEquivalent(this.ToEETypePtr(), handle.ToEETypePtr()));
     }
 }
Esempio n. 4
0
        public bool Equals(RuntimeTypeHandle handle)
        {
#if CORERT
            return(Object.ReferenceEquals(_type, handle._type));
#else
            if (_value == handle._value)
            {
                return(true);
            }
            else if (this.IsNull || handle.IsNull)
            {
                return(false);
            }
            else
            {
                return(RuntimeImports.AreTypesEquivalent(this.ToEETypePtr(), handle.ToEETypePtr()));
            }
#endif
        }
Esempio n. 5
0
 protected override bool CompareValueToValue(RuntimeType value1, RuntimeType value2)
 {
     return(RuntimeImports.AreTypesEquivalent(value1.ToEETypePtr(), value2.ToEETypePtr()));
 }
Esempio n. 6
0
 protected override bool CompareKeyToValue(EETypePtr key, RuntimeType value)
 {
     return(RuntimeImports.AreTypesEquivalent(key, value.ToEETypePtr()));
 }