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:
Alin Rus
2018-01-11 21:40:51 +01:00
parent 1d2eaba300
commit a73aab7cd8
5 changed files with 15 additions and 15 deletions

View File

@@ -516,7 +516,7 @@ UniValue setban(const JSONRPCRequest& request)
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;
if (!isSubnet) {