mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
refactor: increase string_view usage
Update select functions that take a const std::string& to take a
std::string_view instead. In a next commit, this allows us to use
the {Arg,MaybeArg}<std::string_view> helper.
This commit is contained in:
@@ -332,7 +332,7 @@ bool IsLocal(const CService& addr)
|
||||
return mapLocalHost.count(addr) > 0;
|
||||
}
|
||||
|
||||
bool CConnman::AlreadyConnectedToHost(const std::string& host) const
|
||||
bool CConnman::AlreadyConnectedToHost(std::string_view host) const
|
||||
{
|
||||
LOCK(m_nodes_mutex);
|
||||
return std::ranges::any_of(m_nodes, [&host](CNode* node) { return node->m_addr_name == host; });
|
||||
@@ -3626,7 +3626,7 @@ void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats) const
|
||||
}
|
||||
}
|
||||
|
||||
bool CConnman::DisconnectNode(const std::string& strNode)
|
||||
bool CConnman::DisconnectNode(std::string_view strNode)
|
||||
{
|
||||
LOCK(m_nodes_mutex);
|
||||
auto it = std::ranges::find_if(m_nodes, [&strNode](CNode* node) { return node->m_addr_name == strNode; });
|
||||
|
||||
Reference in New Issue
Block a user