Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // source code
- public class Range {
- public IEnumerable<int> Count( int start, int end ) {
- for( int i = start; i <= end; i++ ) {
- yield return i;
- }
- yield break;
- }
- }
- // compiler-generated code
- public class Range
- {
- // Methods
- public IEnumerable<int> Count(int start, int end)
- {
- return new <Count>d__0(-2) { <>4__this = this, <>3__start = start, <>3__end = end };
- }
- // Nested Types
- [CompilerGenerated]
- private sealed class <Count>d__0 : IEnumerable<int>, IEnumerable, IEnumerator<int>, IEnumerator, IDisposable
- {
- // Fields
- private int <>1__state;
- private int <>2__current;
- public int <>3__end;
- public int <>3__start;
- public Range <>4__this;
- private int <>l__initialThreadId;
- public int <i>5__1;
- public int end;
- public int start;
- // Methods
- [DebuggerHidden]
- public <Count>d__0(int <>1__state)
- {
- this.<>1__state = <>1__state;
- this.<>l__initialThreadId = Thread.CurrentThread.ManagedThreadId;
- }
- private bool MoveNext()
- {
- switch (this.<>1__state)
- {
- case 0:
- this.<>1__state = -1;
- this.<i>5__1 = this.start;
- while (this.<i>5__1 <= this.end)
- {
- this.<>2__current = this.<i>5__1;
- this.<>1__state = 1;
- return true;
- Label_004B:
- this.<>1__state = -1;
- this.<i>5__1++;
- }
- break;
- case 1:
- goto Label_004B;
- }
- return false;
- }
- [DebuggerHidden]
- IEnumerator<int> IEnumerable<int>.GetEnumerator()
- {
- Range.<Count>d__0 d__;
- if ((Thread.CurrentThread.ManagedThreadId == this.<>l__initialThreadId) && (this.<>1__state == -2))
- {
- this.<>1__state = 0;
- d__ = this;
- }
- else
- {
- d__ = new Range.<Count>d__0(0) {
- <>4__this = this.<>4__this
- };
- }
- d__.start = this.<>3__start;
- d__.end = this.<>3__end;
- return d__;
- }
- [DebuggerHidden]
- IEnumerator IEnumerable.GetEnumerator()
- {
- return this.System.Collections.Generic.IEnumerable<System.Int32>.GetEnumerator();
- }
- [DebuggerHidden]
- void IEnumerator.Reset()
- {
- throw new NotSupportedException();
- }
- void IDisposable.Dispose()
- {
- }
- // Properties
- int IEnumerator<int>.Current
- {
- [DebuggerHidden]
- get
- {
- return this.<>2__current;
- }
- }
- object IEnumerator.Current
- {
- [DebuggerHidden]
- get
- {
- return this.<>2__current;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement