Followup r72181, condense code, use selectRow()
authorSam Reed <reedy@users.mediawiki.org>
Thu, 2 Sep 2010 16:03:59 +0000 (16:03 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 2 Sep 2010 16:03:59 +0000 (16:03 +0000)
includes/Title.php

index e3e0eb7..d741726 100644 (file)
@@ -3539,20 +3539,13 @@ class Title {
         */
        public function isInCategory( $category ) {
                $dbr = wfGetDB( DB_SLAVE );
-               $res = $dbr->select(
-                       'categorylinks',
-                       '*',
+               return $dbr->selectRow( 'categorylinks', '*',
                        array(
                                'cl_from' => $this->getArticleId(),
                                'cl_to' => $category,
                        ),
-                       __METHOD__,
-                       array(
-                               'LIMIT' => 1
-                       )
+                       __METHOD__
                );
-
-               return ( $dbr->numRows( $res ) > 0 );
        }
 
        /**