From 774511370466667553ad06514935d25d3bc0a113 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 19 Oct 2017 15:32:21 +0200 Subject: [PATCH] Re-use stack variable We're creating the variable but then requesting the 0th element from the list each time... That can be more logical and more efficient. Contributes to issue CURA-4243. --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 5b1e084262..b4fc562378 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -651,13 +651,13 @@ class ThreeMFWorkspaceReader(WorkspaceReader): # HACK # There is a machine, check if it has authentication data. If so, keep that data. - network_authentication_id = container_stacks[0].getMetaDataEntry("network_authentication_id") - network_authentication_key = container_stacks[0].getMetaDataEntry("network_authentication_key") - container_stacks[0].deserialize(archive.open(global_stack_file).read().decode("utf-8")) + network_authentication_id = stack.getMetaDataEntry("network_authentication_id") + network_authentication_key = stack.getMetaDataEntry("network_authentication_key") + stack.deserialize(archive.open(global_stack_file).read().decode("utf-8")) if network_authentication_id: - container_stacks[0].addMetaDataEntry("network_authentication_id", network_authentication_id) + stack.addMetaDataEntry("network_authentication_id", network_authentication_id) if network_authentication_key: - container_stacks[0].addMetaDataEntry("network_authentication_key", network_authentication_key) + stack.addMetaDataEntry("network_authentication_key", network_authentication_key) elif self._resolve_strategies["machine"] == "new": # create a new global stack