Don't needlessly reset article ID
Title::resetArticleID() clears various caches and is meant for when a page was inserted or moved or similar. I can't see any reason that it needs to be called by Title::castFromPageIdentity. Doing so wastes resources and prevents use of the method in unit tests. It is also surprising for a cast to have side effects. Change-Id: I71c523e7406d493c52199c3a5a9ca7cd414bb5eb
This commit is contained in:
parent
c92ab13148
commit
af97e72e76
1 changed files with 1 additions and 1 deletions
|
|
@ -387,7 +387,7 @@ class Title implements LinkTarget, PageIdentity, IDBAccessObject {
|
|||
$title = self::makeTitle( $pageReference->getNamespace(), $pageReference->getDBkey() );
|
||||
|
||||
if ( $pageReference instanceof PageIdentity ) {
|
||||
$title->resetArticleID( $pageReference->getId() );
|
||||
$title->mArticleID = $pageReference->getId();
|
||||
}
|
||||
return $title;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue