* Type.cs (Equals): Better version that does less
trips to runtime land.
svn path=/trunk/mcs/; revision=152988
//
// And we have a patch for that called (trim
+2010-03-03 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * Type.cs (Equals): Better version that does less
+ trips to runtime land.
+
2010-03-03 Rodrigo Kumpera <rkumpera@novell.com>
* MonoType.cs: Add v4 security properties.
#if NET_4_0
public virtual bool Equals (Type o)
{
+ if ((object)o == this)
+ return true;
+ if ((object)o == null)
+ return false;
+ Type me = UnderlyingSystemType;
+ if ((object)me == null)
+ return false;
+
+ o = o.UnderlyingSystemType;
+ if ((object)o == null)
+ return false;
+ if ((object)o == this)
+ return true;
+ return me.EqualsInternal (o);
+ }
#else
public bool Equals (Type o)
{
if (o == this)
return true;
-#endif
if (o == null)
return false;
Type me = UnderlyingSystemType;
return false;
return me.EqualsInternal (o.UnderlyingSystemType);
}
-
+#endif
#if NET_4_0
[MonoTODO ("Implement it properly once 4.0 impl details are known.")]
public static bool operator == (Type left, Type right)