From: jeroendedauw Date: Thu, 10 May 2012 19:06:45 +0000 (+0200) Subject: fix null check and compacted/calrified code X-Git-Tag: 1.31.0-rc.0~22097^2^2~171^2~5 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=b0065ef84e751232c776da03bba46951e6c3e7ac;p=lhc%2Fweb%2Fwiklou.git fix null check and compacted/calrified code Change-Id: I38c7075016f5be0192d85e2a0db273fb100de64b --- diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 5304974b7f..906690b70c 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -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 ) ) + ); } }