mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix RUF015 (next() instead of list comprehensions[0])
https://docs.astral.sh/ruff/rules/-iterable-allocation-for-first-element/
This commit is contained in:
@@ -164,7 +164,7 @@ class CommandFileConstructor:
|
||||
self.calculateRestraints(conn)
|
||||
for el in elements:
|
||||
for rel in el["connections"]:
|
||||
conn = [c for c in connections if c["ref_id"] == rel["related_connection"]][0]
|
||||
conn = next(c for c in connections if c["ref_id"] == rel["related_connection"])
|
||||
rel["conn_string"] = None
|
||||
if conn["geometry_type"] == "Vertex":
|
||||
rel["conn_string"] = "_0DC_"
|
||||
|
||||
Reference in New Issue
Block a user