mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
Use the character based overload for std::string::find.
std::string::find has a character based overload as can be seen here (4th oveload): http://www.cplusplus.com/reference/string/string/find/ Use that instead of constantly allocating temporary strings.
This commit is contained in:
@@ -213,7 +213,7 @@ UniValue RPCConvertNamedValues(const std::string &strMethod, const std::vector<s
|
||||
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 argument (even if it is empty)"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user