mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +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:
parent
1d2eaba300
commit
a73aab7cd8
5 changed files with 15 additions and 15 deletions
|
|
@ -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)"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue