r84711 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84710‎ | r84711 | r84712 >
Date:21:29, 24 March 2011
Author:reedy
Status:ok
Tags:
Comment:
Cache creation of instance of linker
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeView.php
@@ -14,6 +14,11 @@
1515 */
1616 var $skin;
1717
 18+ /**
 19+ * @var CodeCommentLinkerHtml
 20+ */
 21+ var $codeCommentLinker;
 22+
1823 function __construct( $repo ) {
1924 $this->mRepo = ( $repo instanceof CodeRepository )
2025 ? $repo
@@ -21,6 +26,8 @@
2227
2328 global $wgUser;
2429 $this->skin = $wgUser->getSkin();
 30+
 31+ $this->codeCommentLinker = new CodeCommentLinkerHtml( $repo );
2532 }
2633
2734 function validPost( $permission ) {
@@ -44,8 +51,7 @@
4552
4653 function formatMessage( $text ) {
4754 $text = nl2br( htmlspecialchars( $text ) );
48 - $linker = new CodeCommentLinkerHtml( $this->mRepo );
49 - return $linker->link( $text );
 55+ return $this->codeCommentLinker->link( $text );
5056 }
5157
5258 function messageFragment( $value ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r84714Followup r84711...reedy21:41, 24 March 2011

Status & tagging log