From 429f557cc7f68a469f16cb9d5ce37a2cf33221c8 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 23 Aug 2017 20:30:01 +0100 Subject: [PATCH] Skin: Remove more use of QuickTemplate::setRef() Follows-up 2c01147c13be. * language_links: The local array variable is only used once to obtain the value from Skin::getLanguages(), and then never passed elsewhere or otherwise potentially changed, so this reference doesn't seem useful. The getLanguages() method itself also creates a new array every time it is called, so the reference from there can't change either. * Same for content_navigation and content_actions. These are never modified, and the method that returns the array creates a new one on each call. Follows-up r3014 (f4755755daed1f8). * Same for bodytext. Presumably these were only set as references to save memory. Bug: T140664 Change-Id: I1224a7a89c1d7ad05c73132ff73299fd78ade7fb --- includes/skins/SkinTemplate.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php index cbffe1e571..180a6df9c4 100644 --- a/includes/skins/SkinTemplate.php +++ b/includes/skins/SkinTemplate.php @@ -462,11 +462,11 @@ class SkinTemplate extends Skin { $tpl->set( 'printfooter', $this->printSource() ); // Wrap the bodyText with #mw-content-text element $out->mBodytext = $this->wrapHTML( $title, $out->mBodytext ); - $tpl->setRef( 'bodytext', $out->mBodytext ); + $tpl->set( 'bodytext', $out->mBodytext ); $language_urls = $this->getLanguages(); if ( count( $language_urls ) ) { - $tpl->setRef( 'language_urls', $language_urls ); + $tpl->set( 'language_urls', $language_urls ); } else { $tpl->set( 'language_urls', false ); } @@ -475,8 +475,8 @@ class SkinTemplate extends Skin { $tpl->set( 'personal_urls', $this->buildPersonalUrls() ); $content_navigation = $this->buildContentNavigationUrls(); $content_actions = $this->buildContentActionUrls( $content_navigation ); - $tpl->setRef( 'content_navigation', $content_navigation ); - $tpl->setRef( 'content_actions', $content_actions ); + $tpl->set( 'content_navigation', $content_navigation ); + $tpl->set( 'content_actions', $content_actions ); $tpl->set( 'sidebar', $this->buildSidebar() ); $tpl->set( 'nav_urls', $this->buildNavUrls() ); -- 2.20.1