mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01: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:
@@ -423,8 +423,8 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
|
||||
{
|
||||
uint256 txid;
|
||||
int32_t nOutput;
|
||||
std::string strTxid = uriParts[i].substr(0, uriParts[i].find("-"));
|
||||
std::string strOutput = uriParts[i].substr(uriParts[i].find("-")+1);
|
||||
std::string strTxid = uriParts[i].substr(0, uriParts[i].find('-'));
|
||||
std::string strOutput = uriParts[i].substr(uriParts[i].find('-')+1);
|
||||
|
||||
if (!ParseInt32(strOutput, &nOutput) || !IsHex(strTxid))
|
||||
return RESTERR(req, HTTP_BAD_REQUEST, "Parse error");
|
||||
|
||||
Reference in New Issue
Block a user