Last active
December 22, 2015 00:09
-
-
Save shadeglare/6387242 to your computer and use it in GitHub Desktop.
Yield Flaw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEnumerable<SomeClass> SomeMethod1() { | |
yield return new SomeClass(); | |
yield return new SomeClass(); | |
foreach (var elem in SomeMethod2()) { | |
yield return elem; | |
} | |
} | |
IEnumerable<SomeClass> SomeMethod2() { | |
yield return new SomeClass(); | |
yield return new SomeClass(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment