From bf6561ba54c820b44b219f616059cb40419f881f Mon Sep 17 00:00:00 2001 From: hka Date: Mon, 7 Feb 2022 10:38:09 +0100 Subject: [PATCH] Exit loop after finding the resource in a map when checking for the resources existance --- controllers/resources_controller.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/controllers/resources_controller.py b/controllers/resources_controller.py index 1b8714b..b781d4a 100644 --- a/controllers/resources_controller.py +++ b/controllers/resources_controller.py @@ -525,6 +525,13 @@ def _check_unused_resources(self, resources): res.not_referenced = True for resource in resources_from_config: # data and layer types are handled the same + + # When iterating over the `resources_from_config` list, + # the existance of the `res` resource will be checked in all maps. + # This means that when have found the resource in a map, this loop should end. + if res.not_referenced == False: + break + # Check whether the resource parent is referenced if "*" in res.name and res.parent.name in maps_from_config: res.not_referenced = False