Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Performance Fix
Browse files Browse the repository at this point in the history
unsetting a non-existing rule doesn't throw an error.
In our Project this change improves loading time from 55 sec to 0.5 sec
(14412 Resources, 11694 Rules)

see also
zendframework/zf1#737
  • Loading branch information
schrankenstein authored May 5, 2017
1 parent fc91fbe commit b900593
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,7 @@ public function removeResource($resource)
public function removeResourceAll()
{
foreach ($this->resources as $resourceId => $resource) {
foreach ($this->rules['byResourceId'] as $resourceIdCurrent => $rules) {
if ($resourceId === $resourceIdCurrent) {
unset($this->rules['byResourceId'][$resourceIdCurrent]);
}
}
unset($this->rules['byResourceId'][$resourceId]);
}

$this->resources = [];
Expand Down

0 comments on commit b900593

Please sign in to comment.