Use arraySum in _.sum.

This commit is contained in:
John-David Dalton
2015-07-18 20:11:38 -07:00
parent b87a18bd80
commit 7fdbdae6b9
2 changed files with 3 additions and 3 deletions

View File

@@ -11200,7 +11200,7 @@
* // => 10 * // => 10
*/ */
function sum(array) { function sum(array) {
return sumBy(array, identity); return array ? arraySum(array, identity) : 0;
} }
/** /**

View File

@@ -8708,10 +8708,10 @@
} }
}); });
test('`_.sum` should use `_.iteratee` internally', 1, function() { test('`_.sumBy` should use `_.iteratee` internally', 1, function() {
if (!isModularize) { if (!isModularize) {
_.iteratee = getPropB; _.iteratee = getPropB;
strictEqual(_.sum(objects), 1); strictEqual(_.sumBy(objects), 1);
_.iteratee = iteratee; _.iteratee = iteratee;
} }
else { else {