You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by di...@apache.org on 2022/06/28 02:54:18 UTC

[rocketmq-client-cpp] branch master updated: param “mq” is read only,pass by reference instead of value (#421)

This is an automated email from the ASF dual-hosted git repository.

dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new 107072b  param “mq” is read only,pass by reference instead of value (#421)
107072b is described below

commit 107072b264527efbcec0002a7e8c8ddaf6e27f0e
Author: xiaojin <zt...@163.com>
AuthorDate: Tue Jun 28 10:54:12 2022 +0800

    param “mq” is read only,pass by reference instead of value (#421)
    
    (cherry picked from commit 57b584103a30ba1386560b8e54d209975ec7b055)
---
 src/transport/ClientRemotingProcessor.cpp | 2 +-
 src/transport/ClientRemotingProcessor.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/transport/ClientRemotingProcessor.cpp b/src/transport/ClientRemotingProcessor.cpp
index 2c67a0c..6303684 100644
--- a/src/transport/ClientRemotingProcessor.cpp
+++ b/src/transport/ClientRemotingProcessor.cpp
@@ -72,7 +72,7 @@ std::map<MQMessageQueue, int64> ResetOffsetBody::getOffsetTable() {
   return m_offsetTable;
 }
 
-void ResetOffsetBody::setOffsetTable(MQMessageQueue mq, int64 offset) {
+void ResetOffsetBody::setOffsetTable(const MQMessageQueue& mq, int64 offset) {
   m_offsetTable[mq] = offset;
 }
 
diff --git a/src/transport/ClientRemotingProcessor.h b/src/transport/ClientRemotingProcessor.h
index 2b26f28..5d79be4 100644
--- a/src/transport/ClientRemotingProcessor.h
+++ b/src/transport/ClientRemotingProcessor.h
@@ -43,7 +43,7 @@ class ResetOffsetBody {
  public:
   ResetOffsetBody() {}
   virtual ~ResetOffsetBody() { m_offsetTable.clear(); }
-  void setOffsetTable(MQMessageQueue mq, int64 offset);
+  void setOffsetTable(const MQMessageQueue& mq, int64 offset);
   std::map<MQMessageQueue, int64> getOffsetTable();
   static ResetOffsetBody* Decode(const MemoryBlock* mem);