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

Revision: 74070
Author:   reedy
Date:     2010-10-01 14:48:10 +0000 (Fri, 01 Oct 2010)

Log Message:
-----------
Followup r70827, use count against getAuthorList, saves caching extra data, and 
means results don't vary between getAuthorCount and getAuthorList

Modified Paths:
--------------
    trunk/extensions/CodeReview/backend/CodeRepository.php

Modified: trunk/extensions/CodeReview/backend/CodeRepository.php
===================================================================
--- trunk/extensions/CodeReview/backend/CodeRepository.php      2010-10-01 
13:53:49 UTC (rev 74069)
+++ trunk/extensions/CodeReview/backend/CodeRepository.php      2010-10-01 
14:48:10 UTC (rev 74070)
@@ -128,28 +128,7 @@
        }
        
        public function getAuthorCount() {
-               global $wgMemc;
-               $key = wfMemcKey( 'codereview', 'authorcount', $this->getId() );
-               $authorsCount = $wgMemc->get( $key );
-               if ( is_int( $authorsCount ) ) {
-                       return $authorsCount;
-               }
-               $dbr = wfGetDB( DB_SLAVE );
-               $row = $dbr->select(
-                       'code_authors',
-                       array( 'COUNT(cr_author) AS author_count' ),
-                       array( 'cr_repo_id' => $this->getId() ),
-                       __METHOD__
-               );
-
-               if ( !$row ) {
-                       throw new MWException( 'Failed to load expected author 
count' );
-               }
-               
-               $authorsCount = intval( $row->author_count );
-               
-               $wgMemc->set( $key, $authorsCount, 3600 * 24 );
-               return $authorsCount;
+               return count( $this->getAuthorList() );
        }
 
        public function getTagList() {



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

Reply via email to