diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-03-05 04:35:53 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-03-07 00:53:46 +0300 |
commit | 39e77504ba0d1e8de273cd54e1f000166bfa6d0d (patch) | |
tree | 1dcb4a60df9460d8479db5282c5082058f4401fe /include/pam_authenticate.hpp | |
parent | f1eebf06f717d8561ff9bef2828c420ef051cb05 (diff) | |
download | bmcweb-39e77504ba0d1e8de273cd54e1f000166bfa6d0d.tar.xz |
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>
Diffstat (limited to 'include/pam_authenticate.hpp')
-rw-r--r-- | include/pam_authenticate.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/pam_authenticate.hpp b/include/pam_authenticate.hpp index 7f2a33c866..f211a29ec7 100644 --- a/include/pam_authenticate.hpp +++ b/include/pam_authenticate.hpp @@ -17,7 +17,7 @@ inline int pamFunctionConversation(int numMsg, const struct pam_message** msg, 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 @@ inline int pamFunctionConversation(int numMsg, const struct pam_message** msg, *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 @@ inline int pamFunctionConversation(int numMsg, const struct pam_message** msg, 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); |