Part: modernize C++: use range-based for loop
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user