Make code pass clang-tidy-13
clang-tidy-13 appears to have improved its "use brace initialization"
checker to handle more cases, and now correctly fails a couple cases
that we posses. This commit simply makes the very mechanical changes to
make this function.
Tested:
Ran previous commits checks to run ninja clang-tidy, and observed that
clang-tidy now passes.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I665a7f3e71d25af93703e6b31af0f1eb12a44527
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index d89b789..3f398d7 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -905,7 +905,7 @@
if (retry <= 0)
{
BMCWEB_LOG_ERROR << "Failed to generate random number";
- return std::string("");
+ return "";
}
std::shared_ptr<persistent_data::UserSubscription> newSub =
diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp
index f26909b..a316cc5 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -123,14 +123,14 @@
{
BMCWEB_LOG_ERROR << "Required parameters are missing";
messages::internalError(asyncResp->res);
- return std::string();
+ return {};
}
if (*certificateType != "PEM")
{
messages::propertyValueNotInList(asyncResp->res, *certificateType,
"CertificateType");
- return std::string();
+ return {};
}
return certificate;