@@ -221,8 +221,8 @@ static bool ClientAllowed(const CNetAddr& netaddr)
221221static bool InitHTTPAllowList ()
222222{
223223 rpc_allow_subnets.clear ();
224- rpc_allow_subnets.push_back (CSubNet{ LookupHost (" 127.0.0.1" , false ).value (), 8 } ); // always allow IPv4 local subnet
225- rpc_allow_subnets.push_back (CSubNet{ LookupHost (" ::1" , false ).value ()} ); // always allow IPv6 localhost
224+ rpc_allow_subnets.emplace_back ( LookupHost (" 127.0.0.1" , false ).value (), 8 ); // always allow IPv4 local subnet
225+ rpc_allow_subnets.emplace_back ( LookupHost (" ::1" , false ).value ()); // always allow IPv6 localhost
226226 for (const std::string& strAllow : gArgs .GetArgs (" -rpcallowip" )) {
227227 CSubNet subnet;
228228 LookupSubNet (strAllow, subnet);
@@ -364,8 +364,8 @@ static bool HTTPBindAddresses(struct evhttp* http)
364364
365365 // Determine what addresses to bind to
366366 if (!(gArgs .IsArgSet (" -rpcallowip" ) && gArgs .IsArgSet (" -rpcbind" ))) { // Default to loopback if not allowing external IPs
367- endpoints.push_back ( std::make_pair ( " ::1" , http_port) );
368- endpoints.push_back ( std::make_pair ( " 127.0.0.1" , http_port) );
367+ endpoints.emplace_back ( " ::1" , http_port);
368+ endpoints.emplace_back ( " 127.0.0.1" , http_port);
369369 if (gArgs .IsArgSet (" -rpcallowip" )) {
370370 LogPrintf (" WARNING: option -rpcallowip was specified without -rpcbind; this doesn't usually make sense\n " );
371371 }
@@ -377,7 +377,7 @@ static bool HTTPBindAddresses(struct evhttp* http)
377377 uint16_t port{http_port};
378378 std::string host;
379379 SplitHostPort (strRPCBind, port, host);
380- endpoints.push_back ( std::make_pair ( host, port) );
380+ endpoints.emplace_back ( host, port);
381381 }
382382 }
383383
@@ -746,7 +746,7 @@ void RegisterHTTPHandler(const std::string &prefix, bool exactMatch, const HTTPR
746746{
747747 LogPrint (BCLog::HTTP, " Registering HTTP handler for %s (exactmatch %d)\n " , prefix, exactMatch);
748748 LOCK (g_httppathhandlers_mutex);
749- pathHandlers.push_back ( HTTPPathHandler ( prefix, exactMatch, handler) );
749+ pathHandlers.emplace_back ( prefix, exactMatch, handler);
750750}
751751
752752void UnregisterHTTPHandler (const std::string &prefix, bool exactMatch)
0 commit comments