This is an automated email from the ASF dual-hosted git repository. jensg pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git
commit 828ffa8963efe14efd70e1c5c0688bab9f6714db Author: Jens Geyer <[email protected]> AuthorDate: Sat Nov 21 15:15:32 2020 +0100 silenced few warnings Client: netstd Patch: Jens Geyer --- test/netstd/Server/TestServer.cs | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/test/netstd/Server/TestServer.cs b/test/netstd/Server/TestServer.cs index 68461dc..5c99099 100644 --- a/test/netstd/Server/TestServer.cs +++ b/test/netstd/Server/TestServer.cs @@ -34,6 +34,8 @@ using Thrift.Server; using Thrift.Transport; using Thrift.Transport.Server; +#pragma warning disable IDE0063 // using can be simplified, we don't + namespace ThriftTest { internal enum ProtocolChoice @@ -594,21 +596,13 @@ namespace ThriftTest break; } - // Protocol (mandatory) - TProtocolFactory proto; - switch (param.protocol) + TProtocolFactory proto = param.protocol switch { - case ProtocolChoice.Compact: - proto = new TCompactProtocol.Factory(); - break; - case ProtocolChoice.Json: - proto = new TJsonProtocol.Factory(); - break; - case ProtocolChoice.Binary: - default: - proto = new TBinaryProtocol.Factory(); - break; - } + ProtocolChoice.Compact => new TCompactProtocol.Factory(), + ProtocolChoice.Json => new TJsonProtocol.Factory(), + ProtocolChoice.Binary => new TBinaryProtocol.Factory(), + _ => new TBinaryProtocol.Factory(), + }; // Processor var testHandler = new TestHandlerAsync();
