mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
small optimization
not to calculate each quantity twice
This commit is contained in:
@@ -99,10 +99,10 @@ class Qto(blenderbim.core.tool.Qto):
|
|||||||
cls, calculator: QtoCalculator, qto_name: str, obj: bpy.types.Object
|
cls, calculator: QtoCalculator, qto_name: str, obj: bpy.types.Object
|
||||||
) -> dict[str, float]:
|
) -> dict[str, float]:
|
||||||
return {
|
return {
|
||||||
quantity_name: cls.get_rounded_value(calculator.calculate_quantity(qto_name, quantity_name, obj))
|
quantity_name: cls.get_rounded_value(value)
|
||||||
for quantity_name in cls.get_applicable_quantity_names(qto_name) or []
|
for quantity_name in cls.get_applicable_quantity_names(qto_name) or []
|
||||||
if cls.has_calculator(qto_name, quantity_name)
|
if cls.has_calculator(qto_name, quantity_name)
|
||||||
and calculator.calculate_quantity(qto_name, quantity_name, obj) is not None
|
and (value := calculator.calculate_quantity(qto_name, quantity_name, obj)) is not None
|
||||||
}
|
}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user