mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 10:06:47 +00:00
Use constant time parent enumeration lookup
This commit is contained in:
@@ -4952,7 +4952,13 @@ std::pair<Type::Enum, unsigned> Type::GetInverseAttribute(Enum t, const std::str
|
||||
return jt->second;
|
||||
}
|
||||
}
|
||||
if ((t = Parent(t)) == -1) break;
|
||||
boost::optional<Enum> pt = Parent(t);
|
||||
if (pt) {
|
||||
t = *pt;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
throw IfcException("Attribute not found");
|
||||
}
|
||||
@@ -4971,7 +4977,13 @@ std::set<std::string> Type::GetInverseAttributeNames(Enum t) {
|
||||
return_value.insert(jt->first);
|
||||
}
|
||||
}
|
||||
if ((t = Parent(t)) == -1) break;
|
||||
boost::optional<Enum> pt = Parent(t);
|
||||
if (pt) {
|
||||
t = *pt;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return return_value;
|
||||
|
||||
Reference in New Issue
Block a user