mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-07 12:56:26 +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:
@@ -192,7 +192,7 @@ class MODEL:
|
||||
|
||||
el["linkObjs"] = [None for _ in el["connections"]]
|
||||
for j, rel in enumerate(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"])
|
||||
if rel["eccentricity"]:
|
||||
rel["index"] = len(conn["relatedElements"]) + 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user