Merge "Made RepoGroup use ProcessCacheLRU"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 13 Dec 2013 15:51:15 +0000 (15:51 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 13 Dec 2013 15:51:15 +0000 (15:51 +0000)
1  2 
includes/filerepo/RepoGroup.php

@@@ -36,13 -35,10 +36,13 @@@ class RepoGroup 
        /** @var bool */
        protected $reposInitialised = false;
  
 +      /** @var array */
        protected $localInfo;
 +
 +      /** @var array */
        protected $foreignInfo;
  
-       /** @var array  */
+       /** @var ProcessCacheLRU  */
        protected $cache;
  
        /** @var RepoGroup */
                }
        }
  
-       /**
-        * Move a cache entry to the top (such as when accessed)
-        */
-       protected function pingCache( $key ) {
-               if ( isset( $this->cache[$key] ) ) {
-                       $tmp = $this->cache[$key];
-                       unset( $this->cache[$key] );
-                       $this->cache[$key] = $tmp;
-               }
-       }
-       /**
-        * Limit cache memory
-        */
-       protected function trimCache() {
-               while ( count( $this->cache ) >= self::MAX_CACHE_SIZE ) {
-                       reset( $this->cache );
-                       $key = key( $this->cache );
-                       wfDebug( __METHOD__ . ": evicting $key\n" );
-                       unset( $this->cache[$key] );
-               }
-       }
        /**
         * Clear RepoGroup process cache used for finding a file
 -       * @param $title Title|null Title of the file or null to clear all files
 +       * @param Title|null $title Title of the file or null to clear all files
         */
        public function clearCache( Title $title = null ) {
                if ( $title == null ) {