api.js: Add an else to avoid unnecessary checks
authorFomafix <fomafix@googlemail.com>
Tue, 24 Oct 2017 09:23:46 +0000 (11:23 +0200)
committerFomafix <fomafix@googlemail.com>
Tue, 24 Oct 2017 09:23:46 +0000 (11:23 +0200)
If the first if matches then the second if can never match.

Change-Id: I96d59b57cac414c9ee7008e2f284a7a4e3348f3f

resources/src/mediawiki/api.js

index f178698..0e9c19b 100644 (file)
                                        } 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 ];
                                }
                        }