Sketcher: Remove redundant checks
Also cleanup missing curly braces.
This commit is contained in:
committed by
Kacper Donat
parent
ac51f11660
commit
484904e9e1
@@ -1784,8 +1784,9 @@ int SketchObject::delGeometry(int GeoId, bool deleteinternalgeo)
|
||||
Base::StateLocker lock(managedoperation, true);
|
||||
|
||||
const std::vector<Part::Geometry*>& vals = getInternalGeometry();
|
||||
if (GeoId < 0 || GeoId >= int(vals.size()))
|
||||
if (GeoId >= int(vals.size())) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (deleteinternalgeo && hasInternalGeometry(getGeometry(GeoId))) {
|
||||
// Only for supported types
|
||||
@@ -7568,8 +7569,9 @@ const Part::Geometry* SketchObject::_getGeometry(int GeoId) const
|
||||
if (GeoId < int(geomlist.size()))
|
||||
return geomlist[GeoId];
|
||||
}
|
||||
else if (GeoId < 0 && -GeoId-1 < ExternalGeo.getSize())
|
||||
else if (-GeoId-1 < ExternalGeo.getSize()) {
|
||||
return ExternalGeo[-GeoId-1];
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user