From 2ec39249f0fdf34d2b8b601590b8b049b6c44298 Mon Sep 17 00:00:00 2001 From: mxsm Date: Fri, 24 Jan 2025 02:55:48 +0000 Subject: [PATCH] =?UTF-8?q?[ISSUE=20#2386]=F0=9F=94=8D=EF=B8=8FOptimize=20?= =?UTF-8?q?Connection#send=5Fcommand=20performance=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rocketmq-remoting/src/connection.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rocketmq-remoting/src/connection.rs b/rocketmq-remoting/src/connection.rs index 8f3f800f..94e70e14 100644 --- a/rocketmq-remoting/src/connection.rs +++ b/rocketmq-remoting/src/connection.rs @@ -142,8 +142,8 @@ impl Connection { ) -> Result<(), RemotingError> { self.buf.clear(); command.fast_header_encode(&mut self.buf); - if let Some(body_inner) = command.get_body() { - self.buf.put(body_inner.as_ref()); + if let Some(body_inner) = command.take_body() { + self.buf.put(body_inner); } self.writer.send(self.buf.clone()).await?; Ok(())