MDL-53566 core: Remove unused ancestorlocked field

This was originalyl intended as a performance improvement, but the
parent is already stored, and once calculated the value of locked is
already returned.
This commit is contained in:
Andrew Nicols 2018-11-13 08:03:49 +08:00
parent 0333213585
commit 56db1a2d7c

View File

@ -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
*/
@ -5366,8 +5357,7 @@ abstract class context extends stdClass implements IteratorAggregate {
}
if ($parent = $this->get_parent_context()) {
$this->_ancestorlocked = $parent->is_locked();
return $this->_ancestorlocked;
return $parent->is_locked();
}
return false;