refactor: starts/ends_with changes for clang-tidy 20

This commit is contained in:
fanquake
2025-03-18 08:04:23 +08:00
parent 96a5cd8000
commit 2b85d31bcc
11 changed files with 16 additions and 16 deletions

View File

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