mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
refactor: Use explicit function type instead of template
This commit is contained in:
parent
c30f79d418
commit
73f71e1996
1 changed files with 3 additions and 4 deletions
|
@ -258,8 +258,8 @@ public:
|
||||||
|
|
||||||
void PushMessage(CNode* pnode, CSerializedNetMsg&& msg);
|
void PushMessage(CNode* pnode, CSerializedNetMsg&& msg);
|
||||||
|
|
||||||
template<typename Callable>
|
using NodeFn = std::function<void(CNode*)>;
|
||||||
void ForEachNode(Callable&& func)
|
void ForEachNode(const NodeFn& func)
|
||||||
{
|
{
|
||||||
LOCK(cs_vNodes);
|
LOCK(cs_vNodes);
|
||||||
for (auto&& node : vNodes) {
|
for (auto&& node : vNodes) {
|
||||||
|
@ -268,8 +268,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Callable>
|
void ForEachNode(const NodeFn& func) const
|
||||||
void ForEachNode(Callable&& func) const
|
|
||||||
{
|
{
|
||||||
LOCK(cs_vNodes);
|
LOCK(cs_vNodes);
|
||||||
for (auto&& node : vNodes) {
|
for (auto&& node : vNodes) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue