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

Commit

Permalink
Merge branch 'hotfix/29-performance-unset-resource'
Browse files Browse the repository at this point in the history
Close #29
  • Loading branch information
weierophinney committed May 1, 2018
2 parents 48d274e + 4e742dc commit a0937e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- Nothing.
- [#29](https://github.com/zendframework/zend-permissions-acl/pull/29) provides a change to `Acl::removeResourceAll()` that increases performance by a factor of 100.

## 2.6.0 - 2016-02-03

Expand Down
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 a0937e0

Please sign in to comment.