Skip to content

Commit

Permalink
model.base: replace continue with break in NamespaceSet.remove()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jkhsjdhjs authored and s-heppner committed Oct 3, 2023
1 parent 6b4fd27 commit d96c605
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion basyx/aas/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d96c605

Please sign in to comment.