Cleanup _.compact optimization.

This commit is contained in:
John-David Dalton
2013-12-06 19:34:16 -08:00
parent 9a1de81fc5
commit c61a0cdd22

View File

@@ -4501,13 +4501,13 @@
function compact(array) {
var index = -1,
length = array ? array.length : 0,
result = [],
cur = 0,
value;
resIndex = 0,
result = [];
while (++index < length) {
if (value = array[index]) {
result[cur++] = value;
var value = array[index];
if (value) {
result[resIndex++] = value;
}
}
return result;