From d3aea58e7668cf8399a7ac8594bf4d79a6a35c15 Mon Sep 17 00:00:00 2001 From: YangruiEmma Date: Fri, 16 Aug 2024 02:16:03 +0800 Subject: [PATCH] perf: use kitex BinaryProtocol replace apache BinaryProtocol --- pkg/remote/codec/thrift/thrift.go | 2 +- pkg/remote/codec/thrift/thrift_data.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/remote/codec/thrift/thrift.go b/pkg/remote/codec/thrift/thrift.go index e7a9fed13f..ce175342f9 100644 --- a/pkg/remote/codec/thrift/thrift.go +++ b/pkg/remote/codec/thrift/thrift.go @@ -211,7 +211,7 @@ func encodeBasicThrift(out remote.ByteBuffer, ctx context.Context, method string } _ = thrift.Binary.WriteMessageBegin(b, method, thrift.TMessageType(msgType), seqID) - if err := apache.ThriftWrite(apache.NewDefaultTransport(out), data); err != nil { + if err := apache.ThriftWrite(out, data); err != nil { return err } return nil diff --git a/pkg/remote/codec/thrift/thrift_data.go b/pkg/remote/codec/thrift/thrift_data.go index e2732f7b5e..452f0bf66d 100644 --- a/pkg/remote/codec/thrift/thrift_data.go +++ b/pkg/remote/codec/thrift/thrift_data.go @@ -212,7 +212,7 @@ func decodeBasicThriftData(trans remote.ByteBuffer, data interface{}) error { if err = verifyUnmarshalBasicThriftDataType(data); err != nil { return err } - if err = apache.ThriftRead(apache.NewDefaultTransport(trans), data); err != nil { + if err = apache.ThriftRead(trans, data); err != nil { return remote.NewTransError(remote.ProtocolError, err) } return nil