From: Fomafix Date: Tue, 24 Oct 2017 09:23:46 +0000 (+0200) Subject: api.js: Add an else to avoid unnecessary checks X-Git-Tag: 1.31.0-rc.0~1687 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=e73b63dd3b977eb3a1606d88f374a47ac0ae102c api.js: Add an else to avoid unnecessary checks If the first if matches then the second if can never match. Change-Id: I96d59b57cac414c9ee7008e2f284a7a4e3348f3f --- diff --git a/resources/src/mediawiki/api.js b/resources/src/mediawiki/api.js index f178698ce8..0e9c19b4db 100644 --- a/resources/src/mediawiki/api.js +++ b/resources/src/mediawiki/api.js @@ -168,9 +168,8 @@ } else { parameters[ key ] = '\x1f' + parameters[ key ].join( '\x1f' ); } - } - // Boolean values are only false when not given at all - if ( parameters[ key ] === false || parameters[ key ] === undefined ) { + } else if ( parameters[ key ] === false || parameters[ key ] === undefined ) { + // Boolean values are only false when not given at all delete parameters[ key ]; } }