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/account_service.hpp b/redfish-core/lib/account_service.hpp
index c89073b..4fbf3c3 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -31,6 +31,7 @@
#include <array>
#include <optional>
+#include <ranges>
#include <string>
#include <string_view>
#include <vector>
@@ -2007,12 +2008,11 @@
messages::internalError(asyncResp->res);
return;
}
- const auto userIt = std::find_if(
- users.begin(), users.end(),
- [accountName](
- const std::pair<sdbusplus::message::object_path,
- dbus::utility::DBusInteracesMap>& user) {
- return accountName == user.first.filename();
+ const auto userIt = std::ranges::find_if(
+ users, [accountName](
+ const std::pair<sdbusplus::message::object_path,
+ dbus::utility::DBusInteracesMap>& user) {
+ return accountName == user.first.filename();
});
if (userIt == users.end())