Use std::string_view throughout util strencodings/string

This commit is contained in:
Pieter Wuille
2022-04-04 15:05:47 -04:00
committed by MacroFake
parent 8ffbd1412d
commit e7d2fbda63
9 changed files with 69 additions and 56 deletions

View File

@@ -131,7 +131,7 @@ static bool RPCAuthorized(const std::string& strAuth, std::string& strAuthUserna
return false;
if (strAuth.substr(0, 6) != "Basic ")
return false;
std::string strUserPass64 = TrimString(strAuth.substr(6));
std::string_view strUserPass64 = TrimStringView(std::string_view{strAuth}.substr(6));
auto userpass_data = DecodeBase64(strUserPass64);
std::string strUserPass;
if (!userpass_data) return false;