Use constant time parent enumeration lookup

This commit is contained in:
Thomas Krijnen
2016-03-18 11:14:14 +01:00
parent 28560d164c
commit 0ceef8fe67
10 changed files with 103 additions and 1292 deletions
+2 -2
View File
@@ -68,8 +68,8 @@ unsigned int IfcParse::IfcLateBoundEntity::id() const {
bool IfcParse::IfcLateBoundEntity::is(IfcSchema::Type::Enum v) const {
IfcSchema::Type::Enum _ty = _type;
if (v == _ty) return true;
while (_ty != -1) {
_ty = IfcSchema::Type::Parent(_ty);
while (IfcSchema::Type::Parent(_ty)) {
_ty = *IfcSchema::Type::Parent(_ty);
if (v == _ty) return true;
}
return false;