-
Notifications
You must be signed in to change notification settings - Fork 782
Closed
Labels
Description
UnionAsyncIterator has the same issue as reported for UnionIterator and fixed in .NET 5. It seems as simple as moving the call to SetEnumeratorAsync up just before the if.
reactive/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Union.cs
Lines 127 to 134 in bc34728
| ++_index; | |
| var enumerator = enumerable.GetAsyncEnumerator(_cancellationToken); | |
| if (await enumerator.MoveNextAsync().ConfigureAwait(false)) | |
| { | |
| await SetEnumeratorAsync(enumerator).ConfigureAwait(false); | |
| StoreFirst(); |
vs
IEnumerator<TSource> enumerator = enumerable.GetEnumerator();
SetEnumerator(enumerator);
++_state;
if (enumerator.MoveNext())
{
StoreFirst();