diff --git a/build.js b/build.js index 9329ad03c..f7a38dd3d 100755 --- a/build.js +++ b/build.js @@ -138,7 +138,7 @@ 'reject': ['identity'], 'rest': [], 'result': ['isFunction'], - 'shuffle': ['random'], + 'shuffle': [], 'size': ['keys'], 'some': ['identity'], 'sortBy': ['identity'], diff --git a/lodash.js b/lodash.js index 5fd1d31a4..b1190f702 100644 --- a/lodash.js +++ b/lodash.js @@ -2396,8 +2396,9 @@ result = []; while (++index < length) { - if (array[index]) { - result.push(array[index]); + var value = array[index]; + if (value) { + result.push(value); } } return result; @@ -2860,7 +2861,7 @@ result = Array(length); while (++index < length) { - var rand = random(index); + var rand = nativeFloor(nativeRandom() * (index + 1)); result[index] = result[rand]; result[rand] = array[index]; }