@@ -193,7 +193,7 @@ struct InfoTreeNode {
193
193
194
194
InfoTreeNode () : InfoTreeNode(" " , std::monostate{}, " " ) {}
195
195
InfoTreeNode (std::string Key, VariantType Value, std::string Units)
196
- : Key(Key), Value(Value), Units(Units) {}
196
+ : Key(std::move( Key)) , Value(Value), Units(std::move( Units) ) {}
197
197
198
198
// / Add a new info entry as a child of this node. The entry requires at least
199
199
// / a key string in \p Key. The value in \p Value is optional and can be any
@@ -202,7 +202,7 @@ struct InfoTreeNode {
202
202
// / use that value for an appropriate olGetDeviceInfo query
203
203
template <typename T = std::monostate>
204
204
InfoTreeNode *add (std::string Key, T Value = T(),
205
- const std::string & Units = std::string(),
205
+ std::string Units = std::string(),
206
206
std::optional<DeviceInfo> DeviceInfoKey = std::nullopt) {
207
207
assert (!Key.empty () && " Invalid info key" );
208
208
@@ -217,7 +217,8 @@ struct InfoTreeNode {
217
217
else
218
218
ValueVariant = std::string{Value};
219
219
220
- auto Ptr = &Children->emplace_back (Key, ValueVariant, Units);
220
+ auto Ptr =
221
+ &Children->emplace_back (std::move (Key), ValueVariant, std::move (Units));
221
222
222
223
if (DeviceInfoKey)
223
224
DeviceInfoMap[*DeviceInfoKey] = Children->size () - 1 ;
0 commit comments