bmcweb: /s/boost::string_view/std::string_view/g
With boost 1.69, we get the new option, BOOST_BEAST_USE_STD_STRING_VIEW
which allows us to use std::string for all beast interfaces, instead of
boost string_view. This was originally intended to try to reduce the
binary size, but the comparison shows only a minor improvement.
boost::string_view: 7420780 bytes
std::string_view: 7419948 bytes
832 bytes saved ! ! ! ! !
So instead, we will use the argument that it's more standard and easier
for people to grok.
Tested By:
Pulled down some bmcweb endpoints, and observed no change. Because the
two objects are essentially drop in replacements for one another, there
should be no change.
Change-Id: I001e8cf2a0124de4792a7154bf246e3c35ef3f97
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/include/pam_authenticate.hpp b/include/pam_authenticate.hpp
index 7f2a33c..f211a29 100644
--- a/include/pam_authenticate.hpp
+++ b/include/pam_authenticate.hpp
@@ -17,7 +17,7 @@
char* appPass = reinterpret_cast<char*>(appdataPtr);
size_t appPassSize = std::strlen(appPass);
char* pass = reinterpret_cast<char*>(malloc(appPassSize + 1));
- if (!pass)
+ if (pass == nullptr)
{
return PAM_AUTH_ERR;
}
@@ -27,7 +27,7 @@
*resp = reinterpret_cast<pam_response*>(
calloc(numMsg, sizeof(struct pam_response)));
- if (resp == NULL)
+ if (resp == nullptr)
{
return PAM_AUTH_ERR;
}
@@ -47,8 +47,8 @@
return PAM_SUCCESS;
}
-inline bool pamAuthenticateUser(const boost::string_view username,
- const boost::string_view password)
+inline bool pamAuthenticateUser(const std::string_view username,
+ const std::string_view password)
{
std::string userStr(username);
std::string passStr(password);