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

@@ -54,8 +54,9 @@ PropertyGeometryList::PropertyGeometryList()
PropertyGeometryList::~PropertyGeometryList()
{
for (std::vector<Geometry*>::iterator it = _lValueList.begin(); it != _lValueList.end(); ++it)
if (*it) delete *it;
for (auto it : _lValueList) {
if (it) delete it;
}
}
void PropertyGeometryList::setSize(int newSize)
@@ -75,8 +76,8 @@ void PropertyGeometryList::setValue(const Geometry* lValue)
if (lValue) {
aboutToSetValue();
Geometry* newVal = lValue->clone();
for (unsigned int i = 0; i < _lValueList.size(); i++)
delete _lValueList[i];
for (auto it : _lValueList)
delete it;
_lValueList.resize(1);
_lValueList[0] = newVal;
hasSetValue();