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>
diff --git a/redfish-core/lib/health.hpp b/redfish-core/lib/health.hpp
index 55f79bc..0c35cb5 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 @@
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;