]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
messages/MLog: pass rvalue ref instead const ref to ctor
authorKefu Chai <kchai@redhat.com>
Fri, 20 Sep 2019 10:18:35 +0000 (18:18 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 20 Sep 2019 10:21:56 +0000 (18:21 +0800)
easier to use this way. and so far, there is no caller of this function
yet.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/messages/MLog.h

index 0141bf2090b9c8ff409cb0641fa8f15eebd4b0f8..091a7ed23922a114a269d3e8120b3319ad94b13c 100644 (file)
@@ -26,8 +26,8 @@ public:
   std::deque<LogEntry> entries;
   
   MLog() : PaxosServiceMessage{MSG_LOG, 0} {}
-  MLog(const uuid_d& f, const std::deque<LogEntry>& e)
-    : PaxosServiceMessage{MSG_LOG, 0}, fsid(f), entries(e) { }
+  MLog(const uuid_d& f, std::deque<LogEntry>&& e)
+    : PaxosServiceMessage{MSG_LOG, 0}, fsid(f), entries{std::move(e)} { }
   MLog(const uuid_d& f) : PaxosServiceMessage(MSG_LOG, 0), fsid(f) { }
 private:
   ~MLog() override {}