From 3910e91f7883251fa1e732e17653fbbded20241e Mon Sep 17 00:00:00 2001 From: jeroendedauw Date: Fri, 5 Oct 2012 16:14:18 +0200 Subject: [PATCH] Replaced some !count() with explicit and more efficient check Change-Id: I004dbeb6fd00147979ca048d2b3f9f8adc04988a --- includes/SqlDataUpdate.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/SqlDataUpdate.php b/includes/SqlDataUpdate.php index 256e8f74c6..660421e3e2 100644 --- a/includes/SqlDataUpdate.php +++ b/includes/SqlDataUpdate.php @@ -109,7 +109,7 @@ abstract class SqlDataUpdate extends DataUpdate { * @param $dbkeys Array */ protected function invalidatePages( $namespace, array $dbkeys ) { - if ( !count( $dbkeys ) ) { + if ( $dbkeys === array() ) { return; } @@ -127,10 +127,12 @@ abstract class SqlDataUpdate extends DataUpdate { 'page_touched < ' . $this->mDb->addQuotes( $now ) ), __METHOD__ ); + foreach ( $res as $row ) { $ids[] = $row->page_id; } - if ( !count( $ids ) ) { + + if ( $ids === array() ) { return; } -- 2.20.1