Part: modernize C++: use range-based for loop

This commit is contained in:
wmayer
2023-08-15 17:28:50 +02:00
committed by Chris Hennes
parent 9a1f8a11d6
commit 312975edba
49 changed files with 364 additions and 365 deletions

View File

@@ -599,12 +599,12 @@ ShapeHistory Feature::joinHistory(const ShapeHistory& oldH, const ShapeHistory&
ShapeHistory join;
join.type = oldH.type;
for (ShapeHistory::MapList::const_iterator it = oldH.shapeMap.begin(); it != oldH.shapeMap.end(); ++it) {
int old_shape_index = it->first;
if (it->second.empty())
for (const auto & it : oldH.shapeMap) {
int old_shape_index = it.first;
if (it.second.empty())
join.shapeMap[old_shape_index] = ShapeHistory::List();
for (ShapeHistory::List::const_iterator jt = it->second.begin(); jt != it->second.end(); ++jt) {
ShapeHistory::MapList::const_iterator kt = newH.shapeMap.find(*jt);
for (const auto& jt : it.second) {
const auto& kt = newH.shapeMap.find(jt);
if (kt != newH.shapeMap.end()) {
ShapeHistory::List& ary = join.shapeMap[old_shape_index];
ary.insert(ary.end(), kt->second.begin(), kt->second.end());