aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2017-02-06 11:44:38 -0500
committerMatt Corallo <git@bluematt.me>2017-02-10 11:32:40 -0500
commitae683c1b1960b32134f5a5a29504691c91f39cf3 (patch)
tree28065ae3fc560bc8e36fb9b0568422d142ff3371
parent644f1234e22626a7b5618a1dae60a8457a4063b1 (diff)
Avoid copying CNodeStats to make helgrind OK with buggy std::string
-rw-r--r--src/net.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 0e6e00d58b..b7243dce20 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -2420,9 +2420,8 @@ void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats)
vstats.reserve(vNodes.size());
for(std::vector<CNode*>::iterator it = vNodes.begin(); it != vNodes.end(); ++it) {
CNode* pnode = *it;
- CNodeStats stats;
- pnode->copyStats(stats);
- vstats.push_back(stats);
+ vstats.emplace_back();
+ pnode->copyStats(vstats.back());
}
}