mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 10:47:49 -06:00
Fix check if definition with ID exists
It's not an InstanceContainer but a DefinitionContainer. Also, when checking with the ID, it'll short circuit to the dictionary look up by ID. Then it's faster to directly check without specifying what type of container it is to prevent another nested function call. Contributes to issue CURA-6793.
This commit is contained in:
parent
38e723b51c
commit
ab4fade017
1 changed files with 1 additions and 1 deletions
|
@ -91,7 +91,7 @@ class ContainerTree:
|
||||||
# \param definition_id The definition to look for.
|
# \param definition_id The definition to look for.
|
||||||
# \return Whether or not a printer definition exists with that name.
|
# \return Whether or not a printer definition exists with that name.
|
||||||
def __contains__(self, definition_id: str) -> bool:
|
def __contains__(self, definition_id: str) -> bool:
|
||||||
return len(ContainerRegistry.getInstance().findInstanceContainersMetadata(id = definition_id)) == 0
|
return len(ContainerRegistry.getInstance().findContainersMetadata(id = definition_id)) == 0
|
||||||
|
|
||||||
## Returns a machine node for the specified definition ID.
|
## Returns a machine node for the specified definition ID.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue