r70555 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70554‎ | r70555 | r70556 >
Date:11:20, 6 August 2010
Author:reedy
Status:ok
Tags:
Comment:
Reduce unnecessary seperate nested if's, move them up to the top if (as per most of the others where this is necessary!)
Modified paths:
  • /trunk/phase3/includes/api/ApiParamInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiParamInfo.php
@@ -141,19 +141,15 @@
142142 if ( isset( $p[ApiBase::PARAM_DFLT] ) ) {
143143 $a['default'] = $p[ApiBase::PARAM_DFLT];
144144 }
145 - if ( isset( $p[ApiBase::PARAM_ISMULTI] ) ) {
146 - if ( $p[ApiBase::PARAM_ISMULTI] ) {
147 - $a['multi'] = '';
148 - $a['limit'] = $this->getMain()->canApiHighLimits() ?
149 - ApiBase::LIMIT_SML2 :
150 - ApiBase::LIMIT_SML1;
151 - }
 145+ if ( isset( $p[ApiBase::PARAM_ISMULTI] ) && $p[ApiBase::PARAM_ISMULTI] ) {
 146+ $a['multi'] = '';
 147+ $a['limit'] = $this->getMain()->canApiHighLimits() ?
 148+ ApiBase::LIMIT_SML2 :
 149+ ApiBase::LIMIT_SML1;
152150 }
153151
154 - if ( isset( $p[ApiBase::PARAM_ALLOW_DUPLICATES] ) ) {
155 - if ( $p[ApiBase::PARAM_ALLOW_DUPLICATES] ) {
156 - $a['allowsduplicates'] = '';
157 - }
 152+ if ( isset( $p[ApiBase::PARAM_ALLOW_DUPLICATES] ) && $p[ApiBase::PARAM_ALLOW_DUPLICATES] ) {
 153+ $a['allowsduplicates'] = '';
158154 }
159155
160156 if ( isset( $p[ApiBase::PARAM_TYPE] ) ) {

Status & tagging log