From cb51b8da49dfebadea15d216d4a62db2d44a1acb Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 20 Feb 2024 17:11:44 +0500 Subject: [PATCH] style.assign_material_style small optimization --- .../ifcopenshell/api/style/assign_material_style.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/style/assign_material_style.py b/src/ifcopenshell-python/ifcopenshell/api/style/assign_material_style.py index d455c7e894..550f3148f7 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/style/assign_material_style.py +++ b/src/ifcopenshell-python/ifcopenshell/api/style/assign_material_style.py @@ -163,10 +163,10 @@ class Usecase: definition_representation.Representations = representations def has_proposed_style(self, styled_item): - return bool([s for s in styled_item.Styles if s == self.settings["style"]]) + return any(s == self.settings["style"] for s in styled_item.Styles) def has_same_style_type(self, styled_item): - return bool([s for s in styled_item.Styles if s.is_a() == self.settings["style"].is_a()]) + return any(s.is_a() == self.settings["style"].is_a() for s in styled_item.Styles) def create_new_definition_representation(self): representation = self.create_styled_representation()