From 4ced591a3498cffd12ca40bb96aad28cdca85e00 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 12 Feb 2015 10:32:34 +0800 Subject: [PATCH] osd/OpRequest: pass string by const& Signed-off-by: Kefu Chai --- src/osd/OpRequest.cc | 2 +- src/osd/OpRequest.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osd/OpRequest.cc b/src/osd/OpRequest.cc index c455c7cde2a1..12963342feb7 100644 --- a/src/osd/OpRequest.cc +++ b/src/osd/OpRequest.cc @@ -119,7 +119,7 @@ void OpRequest::set_pg_op() { set_rmw_flags(CEPH_OSD_RMW_FLAG_PGOP); } void OpRequest::set_cache() { set_rmw_flags(CEPH_OSD_RMW_FLAG_CACHE); } void OpRequest::set_promote() { set_rmw_flags(CEPH_OSD_RMW_FLAG_PROMOTE); } -void OpRequest::mark_flag_point(uint8_t flag, string s) { +void OpRequest::mark_flag_point(uint8_t flag, const string& s) { #ifdef WITH_LTTNG uint8_t old_flags = hit_flag_points; #endif diff --git a/src/osd/OpRequest.h b/src/osd/OpRequest.h index 1835563470f9..88a2704d5fa4 100644 --- a/src/osd/OpRequest.h +++ b/src/osd/OpRequest.h @@ -138,13 +138,13 @@ public: void mark_reached_pg() { mark_flag_point(flag_reached_pg, "reached_pg"); } - void mark_delayed(string s) { + void mark_delayed(const string& s) { mark_flag_point(flag_delayed, s); } void mark_started() { mark_flag_point(flag_started, "started"); } - void mark_sub_op_sent(string s) { + void mark_sub_op_sent(const string& s) { mark_flag_point(flag_sub_op_sent, s); } void mark_commit_sent() { @@ -166,7 +166,7 @@ public: private: void set_rmw_flags(int flags); - void mark_flag_point(uint8_t flag, string s); + void mark_flag_point(uint8_t flag, const string& s); }; typedef OpRequest::Ref OpRequestRef; -- 2.47.3