Skip to content

Commit

Permalink
Merge pull request #33 from HusseinKabbout/master
Browse files Browse the repository at this point in the history
Exit loop after finding the resource in a map when checking for the resources existance
  • Loading branch information
mwa authored Feb 7, 2022
2 parents 21ad131 + bf6561b commit 70f7498
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions controllers/resources_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 70f7498

Please sign in to comment.