mw.loader: Use Array#indexOf directly instead of jQuery.inArray
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 30 Sep 2017 17:50:53 +0000 (18:50 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 30 Sep 2017 17:50:53 +0000 (18:50 +0100)
commit8ea9d0d7f7acb6afd0d9a42d5e7c7f83f9444fe4
treecc5eb793e4671f923443b3536914bdaf2ea86991
parent5eedf48c5a3a4265109319f2cf0a065d04697e1b
mw.loader: Use Array#indexOf directly instead of jQuery.inArray

Unlike other jQuery methods (which are quite often significantly
faster or slower than native methods), jQuery.inArray is quite
literally a wrapper around Array#indexOf. Use it directly where
possible.

Also:
* Replace `$.inArray(val, [a, b]) !== -1` pattern
  with `val === a || val === b` which is upto 10x faster.
* mw.loader.store.set.: Remove redundant parenthesis in nested expression.

Change-Id: Ia2b922b3245bfb39b609b57e84938317e9c89cd6
resources/src/mediawiki/mediawiki.js