From d96c605599e7ba4420b9dc434dc4eb9c9f7711a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20M=C3=B6ller?= Date: Fri, 29 Sep 2023 16:12:03 +0200 Subject: [PATCH] model.base: replace `continue` with `break` in `NamespaceSet.remove()` If an item has been found, it doesn't make any sense to continue iterating the remaining items. Thus, this `continue` is replaced by a `break`, to break out of the loop once an item has been found. --- basyx/aas/model/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basyx/aas/model/base.py b/basyx/aas/model/base.py index e948a255b..02ee384ea 100644 --- a/basyx/aas/model/base.py +++ b/basyx/aas/model/base.py @@ -1884,7 +1884,7 @@ def remove(self, item: _NSO) -> None: item_in_dict = backend[self._get_attribute(item, attr_name, case_sensitive)] if item_in_dict is item: item_found = True - continue + break if not item_found: raise KeyError("Object not found in NamespaceDict") item.parent = None