mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 11:24:19 +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:
@@ -55,7 +55,7 @@ class COMMANDFILE:
|
||||
conn["relatedElements"] = []
|
||||
for el in elements:
|
||||
for rel in el["connections"]:
|
||||
conn = [c for c in connections if c["referenceName"] == rel["relatedConnection"]][0]
|
||||
conn = next(c for c in connections if c["referenceName"] == rel["relatedConnection"])
|
||||
conn["relatedElements"].append(rel)
|
||||
# End <--
|
||||
|
||||
|
||||
Reference in New Issue
Block a user