Convert Title::getTitleCache() to using MapCacheLRU

Change-Id: I0de4194a37b6ef260d35feb1e6730985775d5351
This commit is contained in:
Aaron Schulz 2018-07-11 14:07:10 +01:00
parent 6cce704da1
commit 7a25cd388c

View file

@ -37,7 +37,7 @@ use MediaWiki\MediaWikiServices;
* and does not rely on global state or the database.
*/
class Title implements LinkTarget {
/** @var HashBagOStuff */
/** @var MapCacheLRU */
static private $titleCache = null;
/**
@ -371,11 +371,11 @@ class Title implements LinkTarget {
}
/**
* @return HashBagOStuff
* @return MapCacheLRU
*/
private static function getTitleCache() {
if ( self::$titleCache == null ) {
self::$titleCache = new HashBagOStuff( [ 'maxKeys' => self::CACHE_MAX ] );
self::$titleCache = new MapCacheLRU( self::CACHE_MAX );
}
return self::$titleCache;
}