// =============== CLASS MEMBERS DECLARATION ===================
@ -1385,6 +1385,65 @@
@@ -1385,6 +1385,65 @@
IL_0051: ret
} // end of method Loops::ForeachWithCapturedVariable
.method public hidebysig static !!T LastOrDefault<T>(class [mscorlib]System.Collections.Generic.IEnumerable`1<!!T> items) cil managed
{
// Code size 69 (0x45)
.maxstack 2
.locals init (!!T V_0,
!!T V_1,
!!T V_2,
class [mscorlib]System.Collections.Generic.IEnumerator`1<!!T> V_3,
bool V_4)
IL_0000: nop
IL_0001: ldloca.s V_0
IL_0003: initobj !!T
IL_0009: nop
IL_000a: ldarg.0
IL_000b: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1<!0> class [mscorlib]System.Collections.Generic.IEnumerable`1<!!T>::GetEnumerator()
IL_0010: stloc.3
.try
{
IL_0011: br.s IL_001e
IL_0013: ldloc.3
IL_0014: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1<!!T>::get_Current()
// =============== CLASS MEMBERS DECLARATION ===================
@ -1120,6 +1120,47 @@
@@ -1120,6 +1120,47 @@
IL_0048: ret
} // end of method Loops::ForeachWithCapturedVariable
.method public hidebysig static !!T LastOrDefault<T>(class [mscorlib]System.Collections.Generic.IEnumerable`1<!!T> items) cil managed
{
// Code size 48 (0x30)
.maxstack 1
.locals init (!!T V_0,
!!T V_1,
class [mscorlib]System.Collections.Generic.IEnumerator`1<!!T> V_2)
IL_0000: ldloca.s V_0
IL_0002: initobj !!T
IL_0008: ldarg.0
IL_0009: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1<!0> class [mscorlib]System.Collections.Generic.IEnumerable`1<!!T>::GetEnumerator()
IL_000e: stloc.2
.try
{
IL_000f: br.s IL_001a
IL_0011: ldloc.2
IL_0012: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1<!!T>::get_Current()
// =============== CLASS MEMBERS DECLARATION ===================
@ -1088,6 +1088,44 @@
@@ -1088,6 +1088,44 @@
IL_0046: ret
} // end of method Loops::ForeachWithCapturedVariable
.method public hidebysig static !!T LastOrDefault<T>(class [mscorlib]System.Collections.Generic.IEnumerable`1<!!T> items) cil managed
{
// Code size 46 (0x2e)
.maxstack 1
.locals init (!!T V_0,
class [mscorlib]System.Collections.Generic.IEnumerator`1<!!T> V_1)
IL_0000: ldloca.s V_0
IL_0002: initobj !!T
IL_0008: ldarg.0
IL_0009: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1<!0> class [mscorlib]System.Collections.Generic.IEnumerable`1<!!T>::GetEnumerator()
IL_000e: stloc.1
.try
{
IL_000f: br.s IL_0018
IL_0011: ldloc.1
IL_0012: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1<!!T>::get_Current()
// =============== CLASS MEMBERS DECLARATION ===================
@ -1303,6 +1303,57 @@
@@ -1303,6 +1303,57 @@
IL_004e: ret
} // end of method Loops::ForeachWithCapturedVariable
.method public hidebysig static !!T LastOrDefault<T>(class [mscorlib]System.Collections.Generic.IEnumerable`1<!!T> items) cil managed
{
// Code size 57 (0x39)
.maxstack 1
.locals init (!!T V_0,
class [mscorlib]System.Collections.Generic.IEnumerator`1<!!T> V_1,
!!T V_2,
!!T V_3)
IL_0000: nop
IL_0001: ldloca.s V_0
IL_0003: initobj !!T
IL_0009: nop
IL_000a: ldarg.0
IL_000b: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1<!0> class [mscorlib]System.Collections.Generic.IEnumerable`1<!!T>::GetEnumerator()
IL_0010: stloc.1
.try
{
IL_0011: br.s IL_001e
IL_0013: ldloc.1
IL_0014: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1<!!T>::get_Current()
/// Unwraps a nested BlockContainer, if container contains only a single block,
/// and that single block contains only a BlockContainer followed by a Leave instruction.
/// If the leave instruction is a return that carries a value, the container is unwrapped only
/// if the value has no side-effects.
/// Otherwise returns the unmodified container.
/// </summary>
/// <param name="optionalReturnInst">If the leave is a return and has no side-effects, we can move the return out of the using-block and put it after the loop, otherwise returns null.</param>