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