Skip to content

Commit 4444b87

Browse files
committed
Merge pull request #5484
7c8e4c5 Make pass-by-ref arguments const. (Daniel Kraft)
2 parents 89802fe + 7c8e4c5 commit 4444b87

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/rest.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ static bool ParseHashStr(const string& strReq, uint256& v)
9090
}
9191

9292
static bool rest_headers(AcceptedConnection* conn,
93-
string& strReq,
94-
map<string, string>& mapHeaders,
93+
const std::string& strReq,
94+
const std::map<std::string, std::string>& mapHeaders,
9595
bool fRun)
9696
{
9797
vector<string> params;
@@ -153,8 +153,8 @@ static bool rest_headers(AcceptedConnection* conn,
153153
}
154154

155155
static bool rest_block(AcceptedConnection* conn,
156-
string& strReq,
157-
map<string, string>& mapHeaders,
156+
const std::string& strReq,
157+
const std::map<std::string, std::string>& mapHeaders,
158158
bool fRun,
159159
bool showTxDetails)
160160
{
@@ -211,24 +211,24 @@ static bool rest_block(AcceptedConnection* conn,
211211
}
212212

213213
static bool rest_block_extended(AcceptedConnection* conn,
214-
string& strReq,
215-
map<string, string>& mapHeaders,
214+
const std::string& strReq,
215+
const std::map<std::string, std::string>& mapHeaders,
216216
bool fRun)
217217
{
218218
return rest_block(conn, strReq, mapHeaders, fRun, true);
219219
}
220220

221221
static bool rest_block_notxdetails(AcceptedConnection* conn,
222-
string& strReq,
223-
map<string, string>& mapHeaders,
222+
const std::string& strReq,
223+
const std::map<std::string, std::string>& mapHeaders,
224224
bool fRun)
225225
{
226226
return rest_block(conn, strReq, mapHeaders, fRun, false);
227227
}
228228

229229
static bool rest_tx(AcceptedConnection* conn,
230-
string& strReq,
231-
map<string, string>& mapHeaders,
230+
const std::string& strReq,
231+
const std::map<std::string, std::string>& mapHeaders,
232232
bool fRun)
233233
{
234234
vector<string> params;
@@ -280,8 +280,8 @@ static bool rest_tx(AcceptedConnection* conn,
280280
static const struct {
281281
const char* prefix;
282282
bool (*handler)(AcceptedConnection* conn,
283-
string& strURI,
284-
map<string, string>& mapHeaders,
283+
const std::string& strURI,
284+
const std::map<std::string, std::string>& mapHeaders,
285285
bool fRun);
286286
} uri_prefixes[] = {
287287
{"/rest/tx/", rest_tx},
@@ -291,8 +291,8 @@ static const struct {
291291
};
292292

293293
bool HTTPReq_REST(AcceptedConnection* conn,
294-
string& strURI,
295-
map<string, string>& mapHeaders,
294+
const std::string& strURI,
295+
const std::map<std::string, std::string>& mapHeaders,
296296
bool fRun)
297297
{
298298
try {

src/rpcserver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ extern json_spirit::Value reconsiderblock(const json_spirit::Array& params, bool
227227

228228
// in rest.cpp
229229
extern bool HTTPReq_REST(AcceptedConnection *conn,
230-
std::string& strURI,
231-
std::map<std::string, std::string>& mapHeaders,
230+
const std::string& strURI,
231+
const std::map<std::string, std::string>& mapHeaders,
232232
bool fRun);
233233

234234
#endif // BITCOIN_RPCSERVER_H

0 commit comments

Comments
 (0)