Skip to content

Commit 2ff5097

Browse files
authored
Use .tail prefix to optimize JIT-generated code (#13)
* Use .tail to optimize JIT-generated code * Fix .Tail -> Tailcall
1 parent 1412153 commit 2ff5097

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

LazyProxy/LazyProxyBuilder.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Concurrent;
33
using System.Collections.Generic;
44
using System.Linq;
@@ -235,6 +235,7 @@ private static TypeBuilder AddMethods(this TypeBuilder typeBuilder, Type type, F
235235
generator.Emit(OpCodes.Ldarg, i);
236236
}
237237

238+
generator.Emit(OpCodes.Tailcall);
238239
generator.Emit(OpCodes.Callvirt, method);
239240
generator.Emit(OpCodes.Ret);
240241

0 commit comments

Comments
 (0)