A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/dotnet/reactive/issues/2112 below:

Union doesn't dispose enumerator for empty lists · Issue #2112 · dotnet/reactive · GitHub

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.

++_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();

(source: https://github.com/dotnet/runtime/blob/714a4420805ed53c311b05381c83c88894100fa9/src/libraries/System.Linq/src/System/Linq/Union.cs#L172-L178)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4