Author: miguel Date: 2008-01-18 03:30:30 -0500 (Fri, 18 Jan 2008) New Revision: 93232
Modified: trunk/mcs/class/System.Core/System.Linq.Expressions/BinaryExpression.cs trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs Log: Remove TypeCode in a few places, there is one place where its actually useful (ConstantExpression.Emit) and I dont feel like rewriting that one Modified: trunk/mcs/class/System.Core/System.Linq.Expressions/BinaryExpression.cs =================================================================== --- trunk/mcs/class/System.Core/System.Linq.Expressions/BinaryExpression.cs 2008-01-18 08:03:10 UTC (rev 93231) +++ trunk/mcs/class/System.Core/System.Linq.Expressions/BinaryExpression.cs 2008-01-18 08:30:30 UTC (rev 93232) @@ -97,12 +97,7 @@ if (t.IsPointer) return IsUnsigned (t.GetElementType ()); - TypeCode tc = Type.GetTypeCode (t); - return tc == TypeCode.UInt16 || - tc == TypeCode.UInt32 || - tc == TypeCode.UInt64 || - tc == TypeCode.Byte; - + return t == typeof (ushort) || t == typeof (uint) || t == typeof (ulong) || t == typeof (byte); } internal override void Emit (EmitContext ec) Modified: trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs =================================================================== --- trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs 2008-01-18 08:03:10 UTC (rev 93231) +++ trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs 2008-01-18 08:30:30 UTC (rev 93232) @@ -75,17 +75,11 @@ #region Binary Expressions static bool IsInt (Type t) { - switch (Type.GetTypeCode (t)) { - case TypeCode.Byte: - case TypeCode.SByte: - case TypeCode.Int16: - case TypeCode.UInt16: - case TypeCode.Int32: - case TypeCode.UInt32: - case TypeCode.Int64: - case TypeCode.UInt64: + if (t == typeof (byte) || t == typeof (sbyte) || + t == typeof (short) || t == typeof (ushort) || + t == typeof (int) || t == typeof (uint) || + t == typeof (long) || t == typeof (ulong)) return true; - } return false; } @@ -95,12 +89,8 @@ if (IsInt (t)) return true; - switch (Type.GetTypeCode (t)) { - case TypeCode.Single: - case TypeCode.Double: - case TypeCode.Decimal: + if (t == typeof (float) || t == typeof (double) || t == typeof (decimal)) return true; - } return false; } _______________________________________________ Mono-patches maillist - Mono-patches@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-patches