diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -334,7 +334,7 @@ bool bScriptHash = false; if (vStrInputParts.size() == 3) { std::string flags = vStrInputParts[2]; - bScriptHash = (flags.find("S") != std::string::npos); + bScriptHash = (flags.find('S') != std::string::npos); } if (bScriptHash) { @@ -395,7 +395,7 @@ bool bScriptHash = false; if (vStrInputParts.size() == numkeys + 4) { std::string flags = vStrInputParts.back(); - bScriptHash = (flags.find("S") != std::string::npos); + bScriptHash = (flags.find('S') != std::string::npos); } else if (vStrInputParts.size() > numkeys + 4) { // Validate that there were no more parameters passed throw std::runtime_error("Too many parameters"); @@ -462,7 +462,7 @@ bool bScriptHash = false; if (vStrInputParts.size() == 3) { std::string flags = vStrInputParts.back(); - bScriptHash = (flags.find("S") != std::string::npos); + bScriptHash = (flags.find('S') != std::string::npos); } if (bScriptHash) { diff --git a/src/httprpc.cpp b/src/httprpc.cpp --- a/src/httprpc.cpp +++ b/src/httprpc.cpp @@ -86,11 +86,11 @@ * config file. */ static bool multiUserAuthorized(std::string strUserPass) { - if (strUserPass.find(":") == std::string::npos) { + if (strUserPass.find(':') == std::string::npos) { return false; } - std::string strUser = strUserPass.substr(0, strUserPass.find(":")); - std::string strPass = strUserPass.substr(strUserPass.find(":") + 1); + std::string strUser = strUserPass.substr(0, strUserPass.find(':')); + std::string strPass = strUserPass.substr(strUserPass.find(':') + 1); for (const std::string &strRPCAuth : gArgs.GetArgs("-rpcauth")) { // Search for multi-user login/pass "rpcauth" from config @@ -142,8 +142,8 @@ boost::trim(strUserPass64); std::string strUserPass = DecodeBase64(strUserPass64); - if (strUserPass.find(":") != std::string::npos) { - strAuthUsernameOut = strUserPass.substr(0, strUserPass.find(":")); + if (strUserPass.find(':') != std::string::npos) { + strAuthUsernameOut = strUserPass.substr(0, strUserPass.find(':')); } // Check if authorized under single-user field diff --git a/src/rest.cpp b/src/rest.cpp --- a/src/rest.cpp +++ b/src/rest.cpp @@ -469,9 +469,9 @@ for (size_t i = (fCheckMemPool) ? 1 : 0; i < uriParts.size(); i++) { int32_t nOutput; - std::string strTxid = uriParts[i].substr(0, uriParts[i].find("-")); + std::string strTxid = uriParts[i].substr(0, uriParts[i].find('-')); std::string strOutput = - uriParts[i].substr(uriParts[i].find("-") + 1); + uriParts[i].substr(uriParts[i].find('-') + 1); if (!ParseInt32(strOutput, &nOutput) || !IsHex(strTxid)) { return RESTERR(req, HTTP_BAD_REQUEST, "Parse error"); diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp --- a/src/rpc/client.cpp +++ b/src/rpc/client.cpp @@ -207,7 +207,7 @@ UniValue params(UniValue::VOBJ); for (const std::string &s : strParams) { - size_t pos = s.find("="); + size_t pos = s.find('='); if (pos == std::string::npos) { throw(std::runtime_error("No '=' in named argument '" + s + "', this needs to be present for every " diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -650,7 +650,7 @@ CNetAddr netAddr; bool isSubnet = false; - if (request.params[0].get_str().find("/") != std::string::npos) { + if (request.params[0].get_str().find('/') != std::string::npos) { isSubnet = true; } diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -614,7 +614,7 @@ s >> nCreditDebit >> nTime >> LIMITED_STRING(strOtherAccount, 65536) >> LIMITED_STRING(strComment, 65536); - size_t nSepPos = strComment.find("\0", 0, 1); + size_t nSepPos = strComment.find('\0'); mapValue.clear(); if (std::string::npos != nSepPos) { CDataStream ss(std::vector(strComment.begin() + nSepPos + 1,