Author: jbevain
Date: 2008-01-22 05:42:47 -0500 (Tue, 22 Jan 2008)
New Revision: 93502

Modified:
   trunk/mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs
Log:
small refactoring

Modified: 
trunk/mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs
===================================================================
--- trunk/mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs     
2008-01-22 10:39:12 UTC (rev 93501)
+++ trunk/mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs     
2008-01-22 10:42:47 UTC (rev 93502)
@@ -84,16 +84,14 @@
 
                internal int GetParameterPosition (ParameterExpression p)
                {
-                       ReadOnlyCollection<ParameterExpression> pars = 
Owner.Parameters;
-                       
-                       for (int i = 0; i < pars.Count; i++){
-                               if (pars [i] == p)
-                                       return i;
-                       }
-                       throw new InvalidOperationException ("Parameter not in 
scope");
+                       int position = Owner.Parameters.IndexOf (p);
+                       if (position == -1)
+                               throw new InvalidOperationException ("Parameter 
not in scope");
+
+                       return position;
                }
        }
-       
+
        public class LambdaExpression : Expression {
 
                //

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to