mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-29 17:19:30 +02:00
refactor: Use explicit function type instead of template
This commit is contained in:
parent
c30f79d418
commit
73f71e1996
@ -258,8 +258,8 @@ public:
|
||||
|
||||
void PushMessage(CNode* pnode, CSerializedNetMsg&& msg);
|
||||
|
||||
template<typename Callable>
|
||||
void ForEachNode(Callable&& func)
|
||||
using NodeFn = std::function<void(CNode*)>;
|
||||
void ForEachNode(const NodeFn& func)
|
||||
{
|
||||
LOCK(cs_vNodes);
|
||||
for (auto&& node : vNodes) {
|
||||
@ -268,8 +268,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Callable>
|
||||
void ForEachNode(Callable&& func) const
|
||||
void ForEachNode(const NodeFn& func) const
|
||||
{
|
||||
LOCK(cs_vNodes);
|
||||
for (auto&& node : vNodes) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user