File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed
src/SignalR/server/Core/src/Internal Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,7 @@ internal static class AsyncEnumeratorAdapters
15
15
public static IAsyncEnumerator < object > GetAsyncEnumeratorFromAsyncEnumerable < T > ( IAsyncEnumerable < T > asyncEnumerable , CancellationToken cancellationToken = default ( CancellationToken ) )
16
16
{
17
17
var enumerator = asyncEnumerable . GetAsyncEnumerator ( cancellationToken ) ;
18
-
19
- if ( typeof ( T ) . IsValueType )
20
- {
21
- return new BoxedAsyncEnumerator < T > ( enumerator ) ;
22
- }
23
-
24
- return ( IAsyncEnumerator < object > ) enumerator ;
18
+ return enumerator as IAsyncEnumerator < object > ?? new BoxedAsyncEnumerator < T > ( enumerator ) ;
25
19
}
26
20
27
21
public static IAsyncEnumerator < object > GetAsyncEnumeratorFromChannel < T > ( ChannelReader < T > channel , CancellationToken cancellationToken = default ( CancellationToken ) )
You can’t perform that action at this time.
0 commit comments