Enable readability-redundant-control-flow checks
These checks are a nice addition to our static analysis, as they
simplify code quite a bit, as can be seen by this diff being negative
lines.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I60ede4ad23d7e5337e811d70ddcab24bf8986891
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index 0bf03cc..d89710b 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -158,8 +158,6 @@
{
messages::internalError(asyncResp->res);
}
-
- return;
}
inline void parseLDAPConfigData(nlohmann::json& jsonResponse,
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 7c2da78..e4e5eb9 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -1853,11 +1853,7 @@
inline bool verifyNames(const std::string& parent, const std::string& iface)
{
- if (!boost::starts_with(iface, parent + "_"))
- {
- return false;
- }
- return true;
+ return boost::starts_with(iface, parent + "_");
}
inline void requestEthernetInterfacesRoutes(App& app)
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index f35db24..9f40725 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -3364,12 +3364,8 @@
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
end = split[1].data() + split[1].size();
auto [ptrValue, ecValue] = std::from_chars(start, end, currentValue);
- if (ptrValue != end || ecValue != std::errc())
- {
- return false;
- }
- return true;
+ return ptrValue == end && ecValue != std::errc();
}
inline void requestRoutesPostCodesEntryAdditionalData(App& app)
diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp
index af0fd12..8e07881 100644
--- a/redfish-core/lib/processor.hpp
+++ b/redfish-core/lib/processor.hpp
@@ -201,8 +201,6 @@
}
}
}
-
- return;
}
inline void getCpuDataByService(std::shared_ptr<bmcweb::AsyncResp> aResp,