Skip to content

Commit e9d0d25

Browse files
committed
Merge pull request #6208
d6922aa [net, trivial] remove using namespace std pollution in netbase.cpp (Philip Kaufmann) 49b2292 [net, trivial] explicitly use std::string for FindNode (Philip Kaufmann)
2 parents 42746b0 + d6922aa commit e9d0d25

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/net.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@ bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOu
13631363
FindNode((CNetAddr)addrConnect) || CNode::IsBanned(addrConnect) ||
13641364
FindNode(addrConnect.ToStringIPPort()))
13651365
return false;
1366-
} else if (FindNode(pszDest))
1366+
} else if (FindNode(std::string(pszDest)))
13671367
return false;
13681368

13691369
CNode* pnode = ConnectNode(addrConnect, pszDest);
@@ -1385,7 +1385,7 @@ void ThreadMessageHandler()
13851385
{
13861386
boost::mutex condition_mutex;
13871387
boost::unique_lock<boost::mutex> lock(condition_mutex);
1388-
1388+
13891389
SetThreadPriority(THREAD_PRIORITY_BELOW_NORMAL);
13901390
while (true)
13911391
{

src/netbase.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
#define MSG_NOSIGNAL 0
3636
#endif
3737

38-
using namespace std;
39-
4038
// Settings
4139
static proxyType proxyInfo[NET_MAX];
4240
static proxyType nameProxy;
@@ -597,13 +595,13 @@ bool ConnectSocket(const CService &addrDest, SOCKET& hSocketRet, int nTimeout, b
597595

598596
bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest, int portDefault, int nTimeout, bool *outProxyConnectionFailed)
599597
{
600-
string strDest;
598+
std::string strDest;
601599
int port = portDefault;
602600

603601
if (outProxyConnectionFailed)
604602
*outProxyConnectionFailed = false;
605603

606-
SplitHostPort(string(pszDest), port, strDest);
604+
SplitHostPort(std::string(pszDest), port, strDest);
607605

608606
proxyType nameProxy;
609607
GetNameProxy(nameProxy);

0 commit comments

Comments
 (0)