We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 04c4aec commit 99087abCopy full SHA for 99087ab
src/Stl/Channels/EnumerableExt.cs
@@ -18,6 +18,9 @@ public static IAsyncEnumerable<T> WithBuffer<T>(
18
bool allowSynchronousContinuations,
19
CancellationToken cancellationToken = default)
20
{
21
+ if (bufferSize < 1)
22
+ return source;
23
+
24
var buffer = source.ToBoundedChannel(new(bufferSize) {
25
SingleReader = true,
26
SingleWriter = true,
@@ -31,6 +34,9 @@ public static IAsyncEnumerable<T> WithBuffer<T>(
31
34
BoundedChannelOptions options,
32
35
33
36
37
+ if (options.Capacity < 1)
38
39
40
var buffer = source.ToBoundedChannel(options, cancellationToken);
41
return buffer.Reader.ReadAllAsync(cancellationToken);
42
}
0 commit comments