Inline partitionInitializer.

This commit is contained in:
John-David Dalton
2014-04-12 17:15:17 -07:00
parent 6631b57fc0
commit 8d8b3c2194

View File

@@ -463,16 +463,6 @@
return typeof value.toString != 'function' && typeof (value + '') == 'string'; return typeof value.toString != 'function' && typeof (value + '') == 'string';
} }
/**
* Used by `_.partition` to create partitioned arrays.
*
* @private
* @returns {Array} Returns the new array.
*/
function partitionInitializer() {
return [[], []];
}
/** /**
* A fallback implementation of `String#trim` to remove leading and trailing * A fallback implementation of `String#trim` to remove leading and trailing
* whitespace or specified characters from `string`. * whitespace or specified characters from `string`.
@@ -4417,7 +4407,7 @@
*/ */
var partition = createAggregator(function(result, value, key) { var partition = createAggregator(function(result, value, key) {
result[key ? 0 : 1].push(value); result[key ? 0 : 1].push(value);
}, partitionInitializer); }, function() { return [[], []]; });
/** /**
* Retrieves the value of a specified property from all elements in the collection. * Retrieves the value of a specified property from all elements in the collection.