From b0065ef84e751232c776da03bba46951e6c3e7ac Mon Sep 17 00:00:00 2001 From: jeroendedauw Date: Thu, 10 May 2012 21:06:45 +0200 Subject: [PATCH] fix null check and compacted/calrified code Change-Id: I38c7075016f5be0192d85e2a0db273fb100de64b --- includes/parser/ParserOutput.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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 ) ) + ); } } -- 2.20.1