summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/param_package.cpp8
-rw-r--r--src/common/param_package.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/common/param_package.cpp b/src/common/param_package.cpp
index 02399b336..9526ca0c6 100644
--- a/src/common/param_package.cpp
+++ b/src/common/param_package.cpp
@@ -3,7 +3,9 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <array> 5#include <array>
6#include <utility>
6#include <vector> 7#include <vector>
8
7#include "common/logging/log.h" 9#include "common/logging/log.h"
8#include "common/param_package.h" 10#include "common/param_package.h"
9#include "common/string_util.h" 11#include "common/string_util.h"
@@ -36,7 +38,7 @@ ParamPackage::ParamPackage(const std::string& serialized) {
36 part = Common::ReplaceAll(part, ESCAPE_CHARACTER_ESCAPE, {ESCAPE_CHARACTER}); 38 part = Common::ReplaceAll(part, ESCAPE_CHARACTER_ESCAPE, {ESCAPE_CHARACTER});
37 } 39 }
38 40
39 Set(key_value[0], key_value[1]); 41 Set(key_value[0], std::move(key_value[1]));
40 } 42 }
41} 43}
42 44
@@ -102,8 +104,8 @@ float ParamPackage::Get(const std::string& key, float default_value) const {
102 } 104 }
103} 105}
104 106
105void ParamPackage::Set(const std::string& key, const std::string& value) { 107void ParamPackage::Set(const std::string& key, std::string value) {
106 data.insert_or_assign(key, value); 108 data.insert_or_assign(key, std::move(value));
107} 109}
108 110
109void ParamPackage::Set(const std::string& key, int value) { 111void ParamPackage::Set(const std::string& key, int value) {
diff --git a/src/common/param_package.h b/src/common/param_package.h
index c4c11b221..7842cd4ef 100644
--- a/src/common/param_package.h
+++ b/src/common/param_package.h
@@ -28,7 +28,7 @@ public:
28 std::string Get(const std::string& key, const std::string& default_value) const; 28 std::string Get(const std::string& key, const std::string& default_value) const;
29 int Get(const std::string& key, int default_value) const; 29 int Get(const std::string& key, int default_value) const;
30 float Get(const std::string& key, float default_value) const; 30 float Get(const std::string& key, float default_value) const;
31 void Set(const std::string& key, const std::string& value); 31 void Set(const std::string& key, std::string value);
32 void Set(const std::string& key, int value); 32 void Set(const std::string& key, int value);
33 void Set(const std::string& key, float value); 33 void Set(const std::string& key, float value);
34 bool Has(const std::string& key) const; 34 bool Has(const std::string& key) const;