Simplify array mapping in basePullAll and baseOrderBy.

This commit is contained in:
John-David Dalton
2016-02-27 18:42:24 -08:00
parent e842bec025
commit 98bdd67cf2

View File

@@ -3227,12 +3227,8 @@
* @returns {Array} Returns the new sorted array.
*/
function baseOrderBy(collection, iteratees, orders) {
var index = -1,
toIteratee = getIteratee();
iteratees = arrayMap(iteratees.length ? iteratees : Array(1), function(iteratee) {
return toIteratee(iteratee);
});
var index = -1;
iteratees = arrayMap(iteratees.length ? iteratees : Array(1), getIteratee());
var result = baseMap(collection, function(value, key, collection) {
var criteria = arrayMap(iteratees, function(iteratee) {
@@ -3327,7 +3323,7 @@
seen = array;
if (iteratee) {
seen = arrayMap(array, function(value) { return iteratee(value); });
seen = arrayMap(array, baseUnary(iteratee));
}
while (++index < length) {
var fromIndex = 0,