From d873e248338b51cf31b23d3f103f773f3b01c0ce Mon Sep 17 00:00:00 2001 From: liuchang0812 Date: Tue, 28 Feb 2017 16:59:41 +0800 Subject: [PATCH] common: use ref to avoid unnecessary memory copy Fixes: http://tracker.ceph.com/issues/19107 Signed-off-by: liuchang0812 --- src/common/ConfUtils.cc | 4 ++-- src/common/ConfUtils.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/ConfUtils.cc b/src/common/ConfUtils.cc index d24990f9719..2c403d950c8 100644 --- a/src/common/ConfUtils.cc +++ b/src/common/ConfUtils.cc @@ -40,8 +40,8 @@ using std::string; ////////////////////////////// ConfLine ////////////////////////////// ConfLine:: -ConfLine(const std::string &key_, const std::string val_, - const std::string newsection_, const std::string comment_, int line_no_) +ConfLine(const std::string &key_, const std::string &val_, + const std::string &newsection_, const std::string &comment_, int line_no_) : key(key_), val(val_), newsection(newsection_) { // If you want to implement writable ConfFile support, you'll need to save diff --git a/src/common/ConfUtils.h b/src/common/ConfUtils.h index 7a5b79a047a..19ec188a711 100644 --- a/src/common/ConfUtils.h +++ b/src/common/ConfUtils.h @@ -39,8 +39,8 @@ */ class ConfLine { public: - ConfLine(const std::string &key_, const std::string val_, - const std::string newsection_, const std::string comment_, int line_no_); + ConfLine(const std::string &key_, const std::string &val_, + const std::string &newsection_, const std::string &comment_, int line_no_); bool operator<(const ConfLine &rhs) const; friend std::ostream &operator<<(std::ostream& oss, const ConfLine &l); -- 2.47.3