aboutsummaryrefslogtreecommitdiff
path: root/src/rest.cpp
diff options
context:
space:
mode:
authorAlin Rus <alin@fsck.ro>2018-01-11 21:40:51 +0100
committerAlin Rus <alin@fsck.ro>2018-01-11 21:40:51 +0100
commita73aab7cd8343d795b1a7408bd71f522262ac76e (patch)
tree3e269a8f345cdd4ae3de43b277a11255295aa2ca /src/rest.cpp
parent1d2eaba300bc13c556e3cb05420dcc91ae12e1d0 (diff)
downloadbitcoin-a73aab7cd8343d795b1a7408bd71f522262ac76e.tar.xz
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.
Diffstat (limited to 'src/rest.cpp')
-rw-r--r--src/rest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rest.cpp b/src/rest.cpp
index 0c93ce020e..30e481171f 100644
--- a/src/rest.cpp
+++ b/src/rest.cpp
@@ -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");