logic: fix -Wrange-loop-construct warning with clang 10
Change-Id: Ia4cd193e099b9e85da48f83087cd93482db9a628
diff --git a/src/logic.cpp b/src/logic.cpp
index 88cd502..e0e6e02 100644
--- a/src/logic.cpp
+++ b/src/logic.cpp
@@ -649,18 +649,18 @@
partialState.reset();
std::vector<ConstLeafPtr> leaves;
- for (const ConstLeafPtr& leaf : state.getLeaves()) {
+ for (const auto& leaf : state.getLeaves()) {
leaves.push_back(leaf);
}
std::shuffle(leaves.begin(), leaves.end(), m_rng);
size_t statesToEncode = leaves.size() - std::min(leaves.size() - 1, nExcludedStates);
- for (const auto& constLeafPtr : leaves) {
+ for (const auto& leaf : leaves) {
if (statesToEncode == 0) {
break;
}
- partialState.update(constLeafPtr->getSessionName(), constLeafPtr->getSeq());
+ partialState.update(leaf->getSessionName(), leaf->getSeq());
--statesToEncode;
}
}