From 00527533c27ab9ab296bba6df754f48acdf5615c Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 24 Mar 2020 08:45:08 -0400 Subject: [PATCH] Suppress analyzer warning about ValueTask usage (#33994) --- .../src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs index 699e5ce..3814e64 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs @@ -149,7 +149,9 @@ namespace System.Net.Http Debug.Assert(_readAheadTask == null || _socket == null, "Should only already have a read-ahead task if we don't have a socket to poll"); if (_readAheadTask == null) { +#pragma warning disable CA2012 // we're very careful to ensure the ValueTask is only consumed once, even though it's stored into a field _readAheadTask = _stream.ReadAsync(new Memory(_readBuffer)); +#pragma warning restore CA2012 } } catch (Exception error) -- 2.7.4