summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-06-26 10:53:34 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-06-26 10:53:34 +0000
commit14e2d148bb82cf15ab4fac1eabbca85cfff49d7b (patch)
tree2fdb43746fdfc5d8fa92b4f775ee23d11e994e3c /storage
parent753bd5781cf57cb50e430aea8cffee995d45c314 (diff)
Modernize to c++11 style loops.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/distributor/activecopy.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/storage/src/vespa/storage/distributor/activecopy.cpp b/storage/src/vespa/storage/distributor/activecopy.cpp
index 4174ddb726f..6739216c1d9 100644
--- a/storage/src/vespa/storage/distributor/activecopy.cpp
+++ b/storage/src/vespa/storage/distributor/activecopy.cpp
@@ -126,9 +126,9 @@ ActiveCopy::calculate(const std::vector<uint16_t>& idealState,
typedef std::vector<uint16_t> IndexList;
std::vector<IndexList> groups;
if (distribution.activePerGroup()) {
- groups = distribution.splitNodesIntoLeafGroups(validNodesWithCopy);
+ groups = distribution.splitNodesIntoLeafGroups(std::move(validNodesWithCopy));
} else {
- groups.push_back(validNodesWithCopy);
+ groups.push_back(std::move(validNodesWithCopy));
}
std::vector<ActiveCopy> result;
for (uint32_t i=0; i<groups.size(); ++i) {
@@ -165,8 +165,8 @@ ActiveList::print(std::ostream& out, bool verbose,
bool
ActiveList::contains(uint16_t node) const
{
- for (uint32_t i=0; i<_v.size(); ++i) {
- if (node == _v[i]._nodeIndex) return true;
+ for (const auto & candadate : _v) {
+ if (node == candadate._nodeIndex) return true;
}
return false;
}