Author: jbevain
Date: 2008-01-22 05:39:12 -0500 (Tue, 22 Jan 2008)
New Revision: 93501

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:34:42 UTC (rev 93500)
+++ trunk/mcs/class/System.Core/System.Linq.Expressions/LambdaExpression.cs     
2008-01-22 10:39:12 UTC (rev 93501)
@@ -160,17 +160,17 @@
 
                internal override void Emit (EmitContext ec)
                {
-                       throw new NotImplementedException ();
+                       body.Emit (ec);
+                       ec.ig.Emit (OpCodes.Ret);
                }
-               
+
                public Delegate Compile ()
                {
                        if (lambda_delegate == null){
-                               EmitContext ec = new EmitContext (this);
-                               
-                               body.Emit (ec);
-                               ec.ig.Emit (OpCodes.Ret);
+                               var ec = new EmitContext (this);
 
+                               Emit (ec);
+
                                if (Environment.GetEnvironmentVariable 
("LINQ_DBG") != null){
                                        string fname = "linq" + 
(EmitContext.method_count-1) + ".dll";
                                        AssemblyBuilder ab = Thread.GetDomain 
().DefineDynamicAssembly (
@@ -180,10 +180,9 @@
                                        TypeBuilder tb = b.DefineType ("LINQ", 
TypeAttributes.Public);
                                        MethodBuilder mb = tb.DefineMethod 
("GeneratedMethod", MethodAttributes.Static, Type, ec.ParamTypes);
                                        ec.ig = mb.GetILGenerator ();
-                                       
-                                       body.Emit (ec);
-                                       ec.ig.Emit (OpCodes.Ret);
-                                       
+
+                                       Emit (ec);
+
                                        tb.CreateType ();
                                        ab.Save (fname);
                                }

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

Reply via email to