Replaced some !count() with explicit and more efficient check
authorjeroendedauw <jeroendedauw@gmail.com>
Fri, 5 Oct 2012 14:14:18 +0000 (16:14 +0200)
committerjeroendedauw <jeroendedauw@gmail.com>
Sun, 7 Oct 2012 21:56:38 +0000 (23:56 +0200)
Change-Id: I004dbeb6fd00147979ca048d2b3f9f8adc04988a

includes/SqlDataUpdate.php

index 256e8f7..660421e 100644 (file)
@@ -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;
                }