Skip to content

Commit

Permalink
clang-tidy: run through performance checks
Browse files Browse the repository at this point in the history
Found with performance*

Signed-off-by: Rosen Penev <rosenp@gmail.com>
  • Loading branch information
neheb authored and KarlStraussberger committed Jan 23, 2024
1 parent 2063614 commit 13b8c01
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/config/config_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,8 @@ std::shared_ptr<pugi::xml_node> ConfigGenerator::setVector(config_option_t optio
auto nodeKey = ConfigDefinition::mapConfigOption(cs->nodeOption);
for (auto&& value : cs->getXmlContent({})) {
setValue(fmt::format("{}/{}/", cs->xpath, nodeKey), "", true);
std::size_t index = 0;
for (auto&& [key, val] : value) {
for (auto&& [key, val] : value)
setValue(fmt::format("{}/{}/attribute::{}", cs->xpath, nodeKey, key), val);
++index;
}
}
return generated[cs->xpath];
}
Expand Down
1 change: 1 addition & 0 deletions src/config/setup/config_setup_vector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ bool ConfigVectorSetup::createOptionFromNode(const pugi::xml_node& optValue, std
if (optValue) {
const auto dictNodes = optValue.select_nodes(ConfigDefinition::mapConfigOption(nodeOption));
std::vector<std::string> attrList;
attrList.reserve(optionList.size());
for (auto& opt : optionList) {
attrList.push_back(ConfigDefinition::removeAttribute(opt));
}
Expand Down
2 changes: 1 addition & 1 deletion src/content/import_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ void ImportService::createItems(AutoScanSetting& settings)

std::pair<bool, std::shared_ptr<CdsObject>> ImportService::createSingleItem(const fs::directory_entry& dirEntry) // ToDo: Use StateEntry here
{
auto objectPath = dirEntry.path();
const auto& objectPath = dirEntry.path();

/* retrieve information about item and decide if it should be included */
auto [skip, mimetype] = mime->getMimeType(objectPath, MIMETYPE_DEFAULT);
Expand Down

0 comments on commit 13b8c01

Please sign in to comment.