* Type.cs: optimize GetTypeCode () for the common case
(fixes bug #367354).
svn path=/trunk/mcs/; revision=97421
+
+Wed Mar 5 19:39:01 CET 2008 Paolo Molaro <lupus@ximian.com>
+
+ * Type.cs: optimize GetTypeCode () for the common case
+ (fixes bug #367354).
+
2008-03-02 Roei Erez <roeie@mainsoft.com>
* DateTime.cs: Improve the patch supplied by James Purcell to be
internal extern static TypeCode GetTypeCodeInternal (Type type);
public static TypeCode GetTypeCode (Type type) {
+ if (type is MonoType)
+ return GetTypeCodeInternal (type);
if (type == null)
/* MS.NET returns this */
return TypeCode.Empty;
type = type.UnderlyingSystemType;
if (!type.IsSystemType)
- return Type.GetTypeCode (typeof (object));
+ return TypeCode.Object;
else
return GetTypeCodeInternal (type);
}