From 724e347ca10e4f452d250bdaffcd4d4d88b3d6f4 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Sat, 16 Nov 2024 02:13:53 -0500 Subject: [PATCH] perf: only call one instance of MediaWikiServices --- includes/TabberTransclude.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/TabberTransclude.php b/includes/TabberTransclude.php index 4df855e..3fd733e 100644 --- a/includes/TabberTransclude.php +++ b/includes/TabberTransclude.php @@ -169,8 +169,9 @@ class TabberTransclude { $frame ); } else { + $service = MediaWikiServices::getInstance(); // Add a link placeholder, as a fallback if JavaScript doesn't execute - $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); + $linkRenderer = $service->getLinkRenderer(); $tabBody = sprintf( '
%s
', $linkRenderer->makeLink( $title, null, [ 'rel' => 'nofollow' ] ) @@ -182,13 +183,13 @@ class TabberTransclude { urlencode( $pageName ) ); - $utils = MediaWikiServices::getInstance()->getUrlUtils(); + $utils = $service->getUrlUtils(); $utils->expand( wfScript( 'api' ) . $query, PROTO_CANONICAL ); $dataProps['load-url'] = $utils->expand( wfScript( 'api' ) . $query, PROTO_CANONICAL ); $oldTabBody = $tabBody; // Allow extensions to update the lazy loaded tab - MediaWikiServices::getInstance()->getHookContainer()->run( + $service->getHookContainer()->run( 'TabberNeueRenderLazyLoadedTab', [ &$tabBody, &$dataProps, $parser, $frame ] );