Skip to content

Commit

Permalink
fix: fixed compilation warning in ConfigurationParser
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicogp committed Nov 25, 2024
1 parent ee66b37 commit 941e62e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/agent/configuration_parser/src/configuration_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace configuration
}

ConfigurationParser::ConfigurationParser(std::function<std::vector<std::string>()> getGroups)
: ConfigurationParser(std::filesystem::path(CONFIG_FILE_NAME), getGroups)
: ConfigurationParser(std::filesystem::path(CONFIG_FILE_NAME), std::move(getGroups))
{
}

Expand Down Expand Up @@ -153,7 +153,7 @@ namespace configuration
{
// Queue to manage nodes to be merged. Pairs of nodes are handled directly.
std::queue<std::pair<YAML::Node, YAML::Node>> nodesToProcess;
nodesToProcess.push({base, override});
nodesToProcess.emplace(base, override);

while (!nodesToProcess.empty())
{
Expand All @@ -163,7 +163,7 @@ namespace configuration
// Traverse each key-value pair in the override node.
for (auto it = overrideNode.begin(); it != overrideNode.end(); ++it)
{
const std::string key = it->first.as<std::string>();
const auto key = it->first.as<std::string>();
YAML::Node value = it->second;

if (baseNode[key])
Expand All @@ -172,7 +172,7 @@ namespace configuration
if (value.IsMap() && baseNode[key].IsMap())
{
// Both values are maps: enqueue for further merging.
nodesToProcess.push({baseNode[key], value});
nodesToProcess.emplace(baseNode[key], value);
}
else if (value.IsSequence() && baseNode[key].IsSequence())
{
Expand Down

0 comments on commit 941e62e

Please sign in to comment.