Author: jbevain Date: 2008-01-18 07:21:14 -0500 (Fri, 18 Jan 2008) New Revision: 93247
Modified: trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs trunk/mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs Log: use common params [] to IEnumerable pattern Modified: trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs =================================================================== --- trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs 2008-01-18 12:18:03 UTC (rev 93246) +++ trunk/mcs/class/System.Core/System.Linq.Expressions/Expression.cs 2008-01-18 12:21:14 UTC (rev 93247) @@ -892,12 +892,7 @@ public static LambdaExpression Lambda (Type delegateType, Expression body, params ParameterExpression [] parameters) { - if (delegateType == null) - throw new ArgumentNullException ("delegateType"); - if (body == null) - throw new ArgumentNullException ("body"); - - return new LambdaExpression (delegateType, body, new ReadOnlyCollection<ParameterExpression> (parameters)); + return Lambda (delegateType, body, parameters as IEnumerable<ParameterExpression>); } [MonoTODO] @@ -908,7 +903,7 @@ if (body == null) throw new ArgumentNullException ("body"); - return new LambdaExpression (delegateType, body, parameters); + return new LambdaExpression (delegateType, body, parameters.ToReadOnlyCollection ()); } public static MemberListBinding ListBind (MemberInfo member, params ElementInit [] initializers) Modified: trunk/mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs =================================================================== --- trunk/mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs 2008-01-18 12:18:03 UTC (rev 93246) +++ trunk/mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs 2008-01-18 12:21:14 UTC (rev 93247) @@ -95,11 +95,6 @@ return target.IsAssignableFrom (source); } - - internal LambdaExpression (Type delegateType, Expression body, IEnumerable<ParameterExpression> parameters) - : this (delegateType, body, new ReadOnlyCollection<ParameterExpression> (new List<ParameterExpression> (parameters))) - { - } internal LambdaExpression (Type delegateType, Expression body, ReadOnlyCollection<ParameterExpression> parameters) : base (ExpressionType.Lambda, body.Type) _______________________________________________ Mono-patches maillist - Mono-patches@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-patches