http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84711

Revision: 84711
Author:   reedy
Date:     2011-03-24 21:29:21 +0000 (Thu, 24 Mar 2011)
Log Message:
-----------
Cache creation of instance of linker

Modified Paths:
--------------
    trunk/extensions/CodeReview/ui/CodeView.php

Modified: trunk/extensions/CodeReview/ui/CodeView.php
===================================================================
--- trunk/extensions/CodeReview/ui/CodeView.php 2011-03-24 21:25:28 UTC (rev 
84710)
+++ trunk/extensions/CodeReview/ui/CodeView.php 2011-03-24 21:29:21 UTC (rev 
84711)
@@ -14,6 +14,11 @@
         */
        var $skin;
 
+       /**
+        * @var CodeCommentLinkerHtml
+        */
+       var $codeCommentLinker;
+
        function __construct( $repo ) {
                $this->mRepo = ( $repo instanceof CodeRepository )
                        ? $repo
@@ -21,6 +26,8 @@
 
                global $wgUser;
                $this->skin = $wgUser->getSkin();
+
+               $this->codeCommentLinker = new CodeCommentLinkerHtml( $repo );
        }
 
        function validPost( $permission ) {
@@ -44,8 +51,7 @@
 
        function formatMessage( $text ) {
                $text = nl2br( htmlspecialchars( $text ) );
-               $linker = new CodeCommentLinkerHtml( $this->mRepo );
-               return $linker->link( $text );
+               return $this->codeCommentLinker->link( $text );
        }
 
        function messageFragment( $value ) {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to