Fix RUF015 (next() instead of list comprehensions[0])

https://docs.astral.sh/ruff/rules/-iterable-allocation-for-first-element/
This commit is contained in:
Andrej730
2025-06-16 12:29:41 +05:00
parent b486b32c8d
commit a12bb343ca
29 changed files with 64 additions and 61 deletions
@@ -166,9 +166,9 @@ class Patcher:
related_elements.append(door_copy)
door.ContainedInStructure[0].RelatedElements = related_elements
body_context = [
body_context = next(
c for c in self.file.by_type("IfcGeometricRepresentationSubContext") if c.ContextIdentifier == "Body"
][0]
)
for subelement in self.file.traverse(footprint_reps[0]):
if not subelement.is_a("IfcShapeRepresentation"):
continue