mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Cache top of stack for efficiency
Otherwise you need to retrieve this container for every key again. Doesn't matter much, but a bit. Contributes to issue CURA-4186.
This commit is contained in:
parent
4a788dfbdd
commit
3c36c3427c
1 changed files with 4 additions and 3 deletions
|
@ -310,9 +310,10 @@ class StartSliceJob(Job):
|
||||||
return
|
return
|
||||||
|
|
||||||
# Check all settings for relations, so we can also calculate the correct values for dependent settings.
|
# Check all settings for relations, so we can also calculate the correct values for dependent settings.
|
||||||
changed_setting_keys = set(stack.getTop().getAllKeys())
|
top_of_stack = stack.getTop() #Cache for efficiency.
|
||||||
for key in stack.getTop().getAllKeys():
|
changed_setting_keys = set(top_of_stack.getAllKeys())
|
||||||
instance = stack.getTop().getInstance(key)
|
for key in top_of_stack.getAllKeys():
|
||||||
|
instance = top_of_stack.getInstance(key)
|
||||||
self._addRelations(changed_setting_keys, instance.definition.relations)
|
self._addRelations(changed_setting_keys, instance.definition.relations)
|
||||||
Job.yieldThread()
|
Job.yieldThread()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue