Skip to content

Commit

Permalink
MDL-53566 core: Remove unused ancestorlocked field
Browse files Browse the repository at this point in the history
This was originalyl intended as a performance improvement, but the
parent is already stored, and once calculated the value of locked is
already returned.
  • Loading branch information
andrewnicols committed Nov 13, 2018
1 parent 0333213 commit 56db1a2
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions lib/accesslib.php
Expand Up @@ -4743,15 +4743,6 @@ abstract class context extends stdClass implements IteratorAggregate {
*/
protected $_locked;

/**
* Whether any parent of the current context is locked.
*
* Can be accessed publicly through $context->ancestorlocked.
*
* @var int
*/
protected $_ancestorlocked;

/**
* @var array Context caching info
*/
Expand Down Expand Up @@ -5366,8 +5357,7 @@ public function is_locked() {
}

if ($parent = $this->get_parent_context()) {
$this->_ancestorlocked = $parent->is_locked();
return $this->_ancestorlocked;
return $parent->is_locked();
}

return false;
Expand Down

0 comments on commit 56db1a2

Please sign in to comment.