Skip to content

Commit d52e687

Browse files
committed
iterator pattern changes
1 parent 41bff47 commit d52e687

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

IteratorPattern/Program.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ public void Remove(RadioStation station)
4343

4444
public IEnumerator<RadioStation> GetEnumerator()
4545
{
46-
return mStations.GetEnumerator();
46+
return this.GetEnumerator();
4747
}
4848

4949
IEnumerator IEnumerable.GetEnumerator()
5050
{
5151
//Use can switch to this internal collection if you do not want to transform
52-
//return this.GetEnumerator();
52+
return mStations.GetEnumerator();
5353

5454
//use this if you want to transform the object before rendering
55-
foreach (var x in mStations)
56-
{
57-
yield return x;
58-
}
55+
//foreach (var x in mStations)
56+
//{
57+
// yield return x;
58+
//}
5959
}
6060
}
6161

0 commit comments

Comments
 (0)