From a495c45fdd218593bcaf47f1614a280047b19d76 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 29 May 2005 10:17:44 +0000 Subject: [PATCH] forward-ported the changes made in 1.40.2.1 --- includes/LinkCache.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/includes/LinkCache.php b/includes/LinkCache.php index 9d86a24a2b..66545eaeb5 100644 --- a/includes/LinkCache.php +++ b/includes/LinkCache.php @@ -45,6 +45,7 @@ class LinkCache { $this->mCategoryLinks = array(); $this->mOldGoodLinks = array(); $this->mOldBadLinks = array(); + $this->mOldPageLinks = array(); } /** @@ -226,9 +227,6 @@ class LinkCache { $this->addBadLinkObj( $title ); } } - $this->mOldPageLinks = $this->mPageLinks; - $this->mOldBadLinks = $this->mBadLinks; - $this->mOldGoodLinks = $this->mGoodLinks; $this->mPreFilled = true; if ( $wgEnablePersistentLC ) { @@ -323,13 +321,17 @@ class LinkCache { } /** - * Clears cache but leaves old preFill copies alone + * Clears cache */ function clear() { $this->mPageLinks = array(); $this->mGoodLinks = array(); $this->mBadLinks = array(); $this->mImageLinks = array(); + $this->mCategoryLinks = array(); + $this->mOldGoodLinks = array(); + $this->mOldBadLinks = array(); + $this->mOldPageLinks = array(); } /** @@ -420,6 +422,15 @@ class LinkCache { $dbw->delete( 'linkscc', array( 'lcc_pageid' => $pid ) ); } } + + /** + * Swaps old and current link registers + */ + function swapRegisters() { + swap( $this->mGoodLinks, $this->mOldGoodLinks ); + swap( $this->mBadLinks, $this->mOldBadLinks ); + swap( $this->mImageLinks, $this->mOldImageLinks ); + } } /** -- 2.20.1