r76300 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76299‎ | r76300 | r76301 >
Date:12:23, 8 November 2010
Author:reedy
Status:ok
Tags:
Comment:
Minor followup r75809, don't use nested if's unnecesserily
Modified paths:
  • /trunk/phase3/includes/api/ApiQuerySearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySearch.php
@@ -139,10 +139,8 @@
140140 if ( isset( $prop['timestamp'] ) ) {
141141 $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $result->getTimestamp() );
142142 }
143 - if ( !is_null( $result->getScore() ) ) {
144 - if ( isset( $prop['score'] ) ) {
145 - $vals['score'] = $result->getScore();
146 - }
 143+ if ( !is_null( $result->getScore() ) && isset( $prop['score'] ) ) {
 144+ $vals['score'] = $result->getScore();
147145 }
148146 if ( isset( $prop['titlesnippet'] ) ) {
149147 $vals['titlesnippet'] = $result->getTitleSnippet( $terms );
@@ -163,10 +161,8 @@
164162 $vals['sectionsnippet'] = $result->getSectionSnippet();
165163 }
166164 }
167 - if ( isset( $prop['hasrelated'] ) ) {
168 - if ( $result->hasRelated() ) {
169 - $vals['hasrelated'] = "";
170 - }
 165+ if ( isset( $prop['hasrelated'] ) && $result->hasRelated() ) {
 166+ $vals['hasrelated'] = "";
171167 }
172168
173169 // Add item to results and see whether it fits

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75809* (bug 25741) Add more data to list=search's srprop. Patch by Brad Jorschreedy18:14, 1 November 2010

Status & tagging log