summaryrefslogtreecommitdiff
path: root/include/openbmc_dbus_rest.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 /include/openbmc_dbus_rest.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 'include/openbmc_dbus_rest.hpp')
-rw-r--r--include/openbmc_dbus_rest.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index 6211fccfa2..7c47bcc5fc 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -56,6 +56,7 @@
#include <limits>
#include <map>
#include <memory>
+#include <ranges>
#include <regex>
#include <string>
#include <string_view>
@@ -2443,7 +2444,7 @@ inline void requestRoutes(App& app)
}
else
{
- std::sort(names.begin(), names.end());
+ std::ranges::sort(names);
asyncResp->res.jsonValue["status"] = "ok";
auto& objectsSub = asyncResp->res.jsonValue["objects"];
for (const auto& name : names)