From 23552223bfe5110749bdb19011e8b2f32c1ee966 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Wed, 19 Mar 2008 13:36:33 +0000 Subject: [PATCH] Remove apparently pointless $dbw parameter to Article::updateCategoryCounts. --- includes/Article.php | 9 +++------ includes/LinksUpdate.php | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 25157081d1..10ff07574a 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2266,7 +2266,7 @@ class Article { foreach( $res as $row ) { $cats []= $row->cl_to; } - $this->updateCategoryCounts( array(), $cats, $dbw ); + $this->updateCategoryCounts( array(), $cats ); # Now that it's safely backed up, delete it $dbw->delete( 'page', array( 'page_id' => $id ), __METHOD__); @@ -3354,14 +3354,11 @@ class Article { * * @param $added array The names of categories that were added * @param $deleted array The names of categories that were deleted - * @param $dbw Database Optional database connection to use * @return null */ - public function updateCategoryCounts( $added, $deleted, $dbw = null ) { + public function updateCategoryCounts( $added, $deleted ) { $ns = $this->mTitle->getNamespace(); - if( !$dbw ) { - $dbw = wfGetDB( DB_MASTER ); - } + $dbw = wfGetDB( DB_MASTER ); # First make sure the rows exist. If one of the "deleted" ones didn't # exist, we might legitimately not create it, but it's simpler to just diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index efda9c46b3..a4774ff37b 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -276,7 +276,7 @@ class LinksUpdate { function updateCategoryCounts( $added, $deleted ) { $a = new Article($this->mTitle); $a->updateCategoryCounts( - array_keys( $added ), array_keys( $deleted ), $this->mDb + array_keys( $added ), array_keys( $deleted ) ); } -- 2.20.1