mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
Fixes after 698c708bf6
This commit is contained in:
+14
-11
@@ -748,18 +748,21 @@ size_t IfcParse::IfcFile::load(unsigned entity_instance_name, const IfcParse::en
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (vector) {
|
if (vector) {
|
||||||
// @todo figure out whether all this logic is still necessary, since we know the
|
// Obviously don't try and create a 0-length array.
|
||||||
// expected amount of attributes and shouldn't be able to access more than allowed
|
if (num_attributes || vector->size()) {
|
||||||
// by the schema.
|
// @todo figure out whether all this logic is still necessary, since we know the
|
||||||
attributes = new Argument*[(std::max)(num_attributes, vector->size())]{ nullptr };
|
// expected amount of attributes and shouldn't be able to access more than allowed
|
||||||
|
// by the schema.
|
||||||
// @todo this appears unnecessary, we increment this in the loop already,
|
attributes = new Argument*[(std::max)(num_attributes, vector->size())]{ nullptr };
|
||||||
// which is more accurate as the filler can't go above it's size in case
|
|
||||||
// it uses the pre-allocated c-array.
|
|
||||||
// -> return_value = vector->size();
|
|
||||||
|
|
||||||
for (size_t i = 0; i < vector->size(); ++i) {
|
// @todo this appears unnecessary, we increment this in the loop already,
|
||||||
attributes[i] = vector->at(i);
|
// which is more accurate as the filler can't go above it's size in case
|
||||||
|
// it uses the pre-allocated c-array.
|
||||||
|
// -> return_value = vector->size();
|
||||||
|
|
||||||
|
for (size_t i = 0; i < vector->size(); ++i) {
|
||||||
|
attributes[i] = vector->at(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((vector != &internal_attribute_vector_) && (vector != &internal_attribute_vector_simple_type_)) {
|
if ((vector != &internal_attribute_vector_) && (vector != &internal_attribute_vector_simple_type_)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user