summaryrefslogtreecommitdiff
path: root/redfish-core/lib/health.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-08-07 04:12:20 +0300
committerEd Tanous <ed@tanous.net>2023-08-21 22:29:33 +0300
commit3544d2a719c8bb7b07f9a39f61a3770ec84b909f (patch)
treedcce5cb8ee0219d04eea93d3f639f62e1f1c05a1 /redfish-core/lib/health.hpp
parent5ab47856f8499a5d2d393d1584b8fc402399eddf (diff)
downloadbmcweb-3544d2a719c8bb7b07f9a39f61a3770ec84b909f.tar.xz
Use ranges
C++20 brought us std::ranges for a lot of algorithms. Most of these conversions were done using comby, similar to: ``` comby -verbose 'std::lower_bound(:[a].begin(),:[b].end(),:[c])' 'std::ranges::lower_bound(:[a], :[c])' $(git ls-files | grep "\.[hc]\(pp\)\?$") -in-place ``` Change-Id: I0c99c04e9368312555c08147d474ca93a5959e8d Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'redfish-core/lib/health.hpp')
-rw-r--r--redfish-core/lib/health.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/redfish-core/lib/health.hpp b/redfish-core/lib/health.hpp
index 55f79bc4bc..0c35cb5ff7 100644
--- a/redfish-core/lib/health.hpp
+++ b/redfish-core/lib/health.hpp
@@ -23,6 +23,7 @@
#include <nlohmann/json.hpp>
#include <array>
+#include <ranges>
#include <string_view>
#include <variant>
@@ -121,9 +122,8 @@ struct HealthPopulate : std::enable_shared_from_this<HealthPopulate>
bool containsChild = false;
for (const std::string& endpoint : *endpoints)
{
- if (std::find(inventory.begin(),
- inventory.end(),
- endpoint) != inventory.end())
+ if (std::ranges::find(inventory, endpoint) !=
+ inventory.end())
{
containsChild = true;
break;