You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2020/11/21 14:22:07 UTC

[thrift] 02/02: silenced few warnings Client: netstd Patch: Jens Geyer

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 <je...@apache.org>
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();