Change-Id: I28a9509ad4c6d724a12dc72bc50d3cf58642c651
*/
private $mGoodLinks;
/**
*/
private $mGoodLinks;
/**
*/
private $mBadLinks;
private $mForUpdate = false;
*/
private $mBadLinks;
private $mForUpdate = false;
protected static $instance;
public function __construct() {
protected static $instance;
public function __construct() {
- $this->mGoodLinks = new MapCacheLRU( self::MAX_SIZE );
- $this->mBadLinks = new MapCacheLRU( self::MAX_SIZE );
+ $this->mGoodLinks = new HashBagOStuff( array( 'maxKeys' => self::MAX_SIZE ) );
+ $this->mBadLinks = new HashBagOStuff( array( 'maxKeys' => self::MAX_SIZE ) );
* @return int Page ID or zero
*/
public function getGoodLinkID( $title ) {
* @return int Page ID or zero
*/
public function getGoodLinkID( $title ) {
- if ( !$this->mGoodLinks->has( $title ) ) {
+ $info = $this->mGoodLinks->get( $title );
+ if ( !$info ) {
- $info = $this->mGoodLinks->get( $title );
*/
public function getGoodLinkFieldObj( $title, $field ) {
$dbkey = $title->getPrefixedDBkey();
*/
public function getGoodLinkFieldObj( $title, $field ) {
$dbkey = $title->getPrefixedDBkey();
- if ( !$this->mGoodLinks->has( $dbkey ) ) {
+ $info = $this->mGoodLinks->get( $dbkey );
+ if ( !$info ) {
- $info = $this->mGoodLinks->get( $dbkey );
*/
public function isBadLink( $title ) {
// Use get() to ensure it records as used for LRU.
*/
public function isBadLink( $title ) {
// Use get() to ensure it records as used for LRU.
- return $this->mBadLinks->get( $title ) !== null;
+ return $this->mBadLinks->get( $title ) !== false;
*/
public function clearLink( $title ) {
$dbkey = $title->getPrefixedDBkey();
*/
public function clearLink( $title ) {
$dbkey = $title->getPrefixedDBkey();
- $this->mBadLinks->clear( array( $dbkey ) );
- $this->mGoodLinks->clear( array( $dbkey ) );
+ $this->mBadLinks->delete( $dbkey );
+ $this->mGoodLinks->delete( $dbkey );