Skip to content

Commit 0a80810

Browse files
Revert "feat: add ToAsyncEnumerable"
This reverts commit a5a938c.
1 parent a5a938c commit 0a80810

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/WouterVanRanst.Utils/Extensions/IEnumerableExtensions.cs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Runtime.CompilerServices;
2-
3-
namespace WouterVanRanst.Utils.Extensions;
1+
namespace WouterVanRanst.Utils.Extensions;
42

53
public static class IEnumerableExtensions
64
{
@@ -74,16 +72,4 @@ public static IEnumerable<T> DuplicatesBy<T, TKey>(this IEnumerable<T> collectio
7472
.Where(group => group.Count() > 1)
7573
.SelectMany(group => group);
7674
}
77-
78-
public static async IAsyncEnumerable<T> ToAsyncEnumerable<T>(this IEnumerable<T> source, [EnumeratorCancellation] CancellationToken cancellationToken = default)
79-
{
80-
foreach (var item in source)
81-
{
82-
cancellationToken.ThrowIfCancellationRequested();
83-
yield return item;
84-
85-
// Give the scheduler a chance to run other work; keeps it truly async-friendly.
86-
await Task.Yield();
87-
}
88-
}
8975
}

0 commit comments

Comments
 (0)