Created
July 9, 2021 19:07
-
-
Save djeikyb/c51e229f7cc12691ac1c6c5de751f54e to your computer and use it in GitHub Desktop.
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
private async IAsyncEnumerable<MemoryStream> YieldStreams(params byte[][] bs) | |
{ | |
// The compiler turns async + yield return type T into the | |
// desired return type of IAsyncEnumerable<T>. But we don't | |
// actually have any async code, just need the type. Soooo | |
await Task.CompletedTask; // hack to evade compiler warning | |
foreach (var b in bs) yield return new MemoryStream(b); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment