Skip to content

Commit

Permalink
[ISSUE #2386]🔍️Optimize Connection#send_command performance 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsm committed Jan 24, 2025
1 parent 9def069 commit 2ec3924
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rocketmq-remoting/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Check warning on line 146 in rocketmq-remoting/src/connection.rs

View check run for this annotation

Codecov / codecov/patch

rocketmq-remoting/src/connection.rs#L145-L146

Added lines #L145 - L146 were not covered by tests
}
self.writer.send(self.buf.clone()).await?;
Ok(())
Expand Down

0 comments on commit 2ec3924

Please # to comment.