mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-29 19:51:00 +00:00
Fixes after 698c708bf6
This commit is contained in:
@@ -130,7 +130,7 @@ private:
|
|||||||
const IfcParse::schema_definition* schema_;
|
const IfcParse::schema_definition* schema_;
|
||||||
const IfcParse::declaration* ifcroot_type_;
|
const IfcParse::declaration* ifcroot_type_;
|
||||||
|
|
||||||
std::vector<Argument*> internal_attribute_vector_;
|
std::vector<Argument*> internal_attribute_vector_, internal_attribute_vector_simple_type_;
|
||||||
|
|
||||||
entity_by_id_t byid;
|
entity_by_id_t byid;
|
||||||
entities_by_type_t bytype;
|
entities_by_type_t bytype;
|
||||||
|
|||||||
@@ -699,7 +699,11 @@ size_t IfcParse::IfcFile::load(unsigned entity_instance_name, const IfcParse::en
|
|||||||
// If num_attributes is zero we know this is a top-level entity instance (or header entity) being parsed.
|
// If num_attributes is zero we know this is a top-level entity instance (or header entity) being parsed.
|
||||||
// There can only be parsed one of these at a time, so we can reuse the vector we have defined at the file
|
// There can only be parsed one of these at a time, so we can reuse the vector we have defined at the file
|
||||||
// scope.
|
// scope.
|
||||||
vector = &internal_attribute_vector_;
|
if (entity) {
|
||||||
|
vector = &internal_attribute_vector_;
|
||||||
|
} else {
|
||||||
|
vector = &internal_attribute_vector_simple_type_;
|
||||||
|
}
|
||||||
vector->clear();
|
vector->clear();
|
||||||
} else {
|
} else {
|
||||||
vector = new std::vector<Argument*>;
|
vector = new std::vector<Argument*>;
|
||||||
@@ -758,7 +762,7 @@ size_t IfcParse::IfcFile::load(unsigned entity_instance_name, const IfcParse::en
|
|||||||
attributes[i] = vector->at(i);
|
attributes[i] = vector->at(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vector != &internal_attribute_vector_) {
|
if ((vector != &internal_attribute_vector_) && (vector != &internal_attribute_vector_simple_type_)) {
|
||||||
delete vector;
|
delete vector;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1487,6 +1491,7 @@ void IfcFile::initialize_(IfcParse::IfcSpfStream* s) {
|
|||||||
|
|
||||||
// prevent heap allocations during parse
|
// prevent heap allocations during parse
|
||||||
internal_attribute_vector_.reserve(64);
|
internal_attribute_vector_.reserve(64);
|
||||||
|
internal_attribute_vector_simple_type_.reserve(16);
|
||||||
|
|
||||||
parsing_complete_ = false;
|
parsing_complete_ = false;
|
||||||
MaxId = 0;
|
MaxId = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user