Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions offload/plugins-nextgen/common/include/PluginInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ struct InfoTreeNode {

InfoTreeNode() : InfoTreeNode("", std::monostate{}, "") {}
InfoTreeNode(std::string Key, VariantType Value, std::string Units)
: Key(Key), Value(Value), Units(Units) {}
: Key(std::move(Key)), Value(Value), Units(std::move(Units)) {}

/// Add a new info entry as a child of this node. The entry requires at least
/// a key string in \p Key. The value in \p Value is optional and can be any
Expand All @@ -202,7 +202,7 @@ struct InfoTreeNode {
/// use that value for an appropriate olGetDeviceInfo query
template <typename T = std::monostate>
InfoTreeNode *add(std::string Key, T Value = T(),
const std::string &Units = std::string(),
std::string Units = std::string(),
std::optional<DeviceInfo> DeviceInfoKey = std::nullopt) {
assert(!Key.empty() && "Invalid info key");

Expand All @@ -217,7 +217,8 @@ struct InfoTreeNode {
else
ValueVariant = std::string{Value};

auto Ptr = &Children->emplace_back(Key, ValueVariant, Units);
auto Ptr =
&Children->emplace_back(std::move(Key), ValueVariant, std::move(Units));

if (DeviceInfoKey)
DeviceInfoMap[*DeviceInfoKey] = Children->size() - 1;
Expand Down
Loading