Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Pass values by reference #2408

Merged
merged 1 commit into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ CNode* FindNode(const CNetAddr& ip)
return nullptr;
}

CNode* FindNode(std::string addrName)
CNode* FindNode(const std::string& addrName)
{
LOCK(cs_vNodes);
for (auto const& pnode : vNodes) {
Expand Down
4 changes: 2 additions & 2 deletions src/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe
return true;
}

bool SetProxy(enum Network net, CService addrProxy) {
bool SetProxy(enum Network net, const CService &addrProxy) {
assert(net >= 0 && net < NET_MAX);
if (!addrProxy.IsValid())
return false;
Expand All @@ -398,7 +398,7 @@ bool GetProxy(enum Network net, proxyType &proxyInfoOut) {
return true;
}

bool SetNameProxy(CService addrProxy) {
bool SetNameProxy(const CService &addrProxy) {
if (!addrProxy.IsValid())
return false;
LOCK(cs_proxyInfos);
Expand Down
8 changes: 4 additions & 4 deletions src/netbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ class CService : public CNetAddr
typedef CService proxyType;

enum Network ParseNetwork(std::string net);
bool SetProxy(enum Network net, CService addrProxy);
bool GetProxy(enum Network net, proxyType &proxyInfoOut);
bool IsProxy(const CNetAddr &addr);
bool SetNameProxy(CService addrProxy);
bool SetProxy(enum Network net, const CService& addrProxy);
bool GetProxy(enum Network net, proxyType& proxyInfoOut);
bool IsProxy(const CNetAddr& addr);
bool SetNameProxy(const CService& addrProxy);
bool HaveNameProxy();
bool LookupHost(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions = 0, bool fAllowLookup = true);
bool Lookup(const char *pszName, CService& addr, int portDefault = 0, bool fAllowLookup = true);
Expand Down