Skip to content
This repository was archived by the owner on Oct 16, 2019. It is now read-only.

Commit 7272dc2

Browse files
authored
Performance Fix zendframework#737
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)
1 parent e25cea2 commit 7272dc2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

library/Zend/Acl.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,7 @@ public function remove($resource)
481481
public function removeAll()
482482
{
483483
foreach ($this->_resources as $resourceId => $resource) {
484-
foreach ($this->_rules['byResourceId'] as $resourceIdCurrent => $rules) {
485-
if ($resourceId === $resourceIdCurrent) {
486-
unset($this->_rules['byResourceId'][$resourceIdCurrent]);
487-
}
488-
}
484+
unset($this->_rules['byResourceId'][$resourceId]);
489485
}
490486

491487
$this->_resources = array();

0 commit comments

Comments
 (0)