automatic clang-tidy fixes
Apply fixes automatically generated by clang-tidy when ran with
clang-tidy-20. These appear to be optimization fixes around usage
of std::map and/or std::unordered_map.
Change-Id: I920cf1c6f27f0f1ecb219e83736f390544ded10e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/src/entity_manager/perform_scan.cpp b/src/entity_manager/perform_scan.cpp
index 167490b..a31e7a1 100644
--- a/src/entity_manager/perform_scan.cpp
+++ b/src/entity_manager/perform_scan.cpp
@@ -434,7 +434,7 @@
if (!replaceStr && replaceVal)
{
- if (usedNames.find(copyIt.value()) != usedNames.end())
+ if (usedNames.contains(copyIt.value()))
{
replaceStr = replaceVal;
copyForName = {{"Name", nameTemplate}};
diff --git a/src/entity_manager/topology.cpp b/src/entity_manager/topology.cpp
index ed827ad..fa95a85 100644
--- a/src/entity_manager/topology.cpp
+++ b/src/entity_manager/topology.cpp
@@ -66,11 +66,11 @@
for (const Path& downstream : downstreamMatch->second)
{
// The downstream path must be one we care about.
- if (boards.find(downstream) != boards.end())
+ if (boards.contains(downstream))
{
result[downstream].emplace_back("contained_by",
"containing", upstream);
- if (powerPaths.find(downstream) != powerPaths.end())
+ if (powerPaths.contains(downstream))
{
result[upstream].emplace_back(
"powered_by", "powering", downstream);