[core] ListAttribute: add early return test for value setter

Skip value assignment when the value is a list identical to the ListAttribute's
current value.
This avoids internal models and graph update, which can have a
significant impact on performance when the number of elements grows.
This commit is contained in:
Yann Lanthony 2025-01-29 19:11:08 +01:00
parent 70546c753b
commit 2f6d802445

View file

@ -535,6 +535,8 @@ class ListAttribute(Attribute):
self.valueChanged.emit()
def _set_value(self, value):
if isinstance(value, list) and value == self.getExportValue():
return
if self.node.graph:
self.remove(0, len(self))
# Link to another attribute