From 56db1a2d7c11016c786a38550c52a840fdc19c86 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Tue, 13 Nov 2018 08:03:49 +0800 Subject: [PATCH] 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. --- lib/accesslib.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/accesslib.php b/lib/accesslib.php index c5a13fea1a2..c95bdc5dcc0 100644 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -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;