fix null check and compacted/calrified code
authorjeroendedauw <jeroendedauw@gmail.com>
Thu, 10 May 2012 19:06:45 +0000 (21:06 +0200)
committerjeroendedauw <jeroendedauw@gmail.com>
Thu, 10 May 2012 19:06:45 +0000 (21:06 +0200)
Change-Id: I38c7075016f5be0192d85e2a0db273fb100de64b

includes/parser/ParserOutput.php

index 5304974..906690b 100644 (file)
@@ -472,18 +472,13 @@ class ParserOutput extends CacheTime {
      * @return array an array of instances of SecondaryDataUpdate
      */
     public function getSecondaryDataUpdates( Title $title = null, $recursive = true ) {
-        if ( empty( $title ) ) {
+        if ( is_null( $title ) ) {
             $title = Title::newFromText( $this->getTitleText() );
         }
 
-        $linksUpdate = new LinksUpdate( $title, $this, $recursive );
-
-        if ( empty( $this->mSecondaryDataUpdates ) ) {
-            return array( $linksUpdate );
-        } else {
-            $updates = array_merge( $this->mSecondaryDataUpdates, array( $linksUpdate ) );
-        }
-
-        return $updates;
+        return array_merge(
+                       $this->mSecondaryDataUpdates,
+                       array( new LinksUpdate( $title, $this, $recursive ) )
+               );
     }
 }