0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

refactor: Use explicit function type instead of template

This commit is contained in:
Hennadii Stepanov 2020-09-19 11:52:27 +03:00
parent c30f79d418
commit 73f71e1996
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

View file

@ -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) {