From d4d805cb3e7a4fb3d41a4d5dbb494827cbd79c26 Mon Sep 17 00:00:00 2001 From: Dan Ben Yosef Date: Fri, 12 Mar 2021 14:17:11 -0500 Subject: [PATCH] Avoiding copy by passing param by reference It is best to pass bad_value_ param by reference to avoid copy. --- modules/core/src/system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index d0412a36e5..6e882e1dde 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -1938,7 +1938,7 @@ class ParseError { std::string bad_value; public: - ParseError(const std::string bad_value_) :bad_value(bad_value_) {} + ParseError(const std::string &bad_value_) :bad_value(bad_value_) {} std::string toString(const std::string ¶m) const { std::ostringstream out;