Reduce unnecessary seperate nested if's, move them up to the top if (as per most...
authorSam Reed <reedy@users.mediawiki.org>
Fri, 6 Aug 2010 11:20:39 +0000 (11:20 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Fri, 6 Aug 2010 11:20:39 +0000 (11:20 +0000)
includes/api/ApiParamInfo.php

index 793c274..6e26b30 100644 (file)
@@ -141,19 +141,15 @@ class ApiParamInfo extends ApiBase {
                        if ( isset( $p[ApiBase::PARAM_DFLT] ) ) {
                                $a['default'] = $p[ApiBase::PARAM_DFLT];
                        }
-                       if ( isset( $p[ApiBase::PARAM_ISMULTI] ) ) {
-                               if ( $p[ApiBase::PARAM_ISMULTI] ) {
-                                       $a['multi'] = '';
-                                       $a['limit'] = $this->getMain()->canApiHighLimits() ?
-                                                       ApiBase::LIMIT_SML2 :
-                                                       ApiBase::LIMIT_SML1;
-                               }
+                       if ( isset( $p[ApiBase::PARAM_ISMULTI] ) && $p[ApiBase::PARAM_ISMULTI] ) {
+                               $a['multi'] = '';
+                               $a['limit'] = $this->getMain()->canApiHighLimits() ?
+                                               ApiBase::LIMIT_SML2 :
+                                               ApiBase::LIMIT_SML1;
                        }
 
-                       if ( isset( $p[ApiBase::PARAM_ALLOW_DUPLICATES] ) ) {
-                               if ( $p[ApiBase::PARAM_ALLOW_DUPLICATES] ) {
-                                       $a['allowsduplicates'] = '';
-                               }
+                       if ( isset( $p[ApiBase::PARAM_ALLOW_DUPLICATES] ) && $p[ApiBase::PARAM_ALLOW_DUPLICATES] ) {
+                               $a['allowsduplicates'] = '';
                        }
 
                        if ( isset( $p[ApiBase::PARAM_TYPE] ) ) {