Explicit comparison operator for length

This yields more performance on some JavaScript engines as it saves one implicit type cast.
pull/49/head
Philzen 11 years ago
parent d1d839f623
commit 3151bae751

@ -40,7 +40,7 @@ function naturalSort (a, b) {
xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
// numeric, hex or date detection
xD = parseInt(x.match(hre), 10) || (xN.length != 1 && x.match(dre) && Date.parse(x)),
xD = parseInt(x.match(hre), 10) || (xN.length !== 1 && x.match(dre) && Date.parse(x)),
yD = parseInt(y.match(hre), 10) || xD && y.match(dre) && Date.parse(y) || null;
// first try and sort Hex codes or Dates

Loading…
Cancel
Save