mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
entity_instance.__getattr__ - small optimization for inverse attrs
Stop iterating early and don't build a list to make it a bit more optimized. Though I'm unsure if anyone is really using `unpack_non_aggregate_inverses`
This commit is contained in:
@@ -206,7 +206,7 @@ class entity_instance:
|
||||
schema_name = self.wrapped_data.is_a(True).split(".")[0]
|
||||
ent: ifcopenshell_wrapper.entity
|
||||
ent = ifcopenshell_wrapper.schema_by_name(schema_name).declaration_by_name(self.is_a())
|
||||
inv = [i for i in ent.all_inverse_attributes() if i.name() == name][0]
|
||||
inv = next(i for i in ent.all_inverse_attributes() if i.name() == name)
|
||||
if (inv.bound1(), inv.bound2()) == (-1, -1):
|
||||
if vs:
|
||||
vs = vs[0]
|
||||
|
||||
Reference in New Issue
Block a user