1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2024-12-26 07:33:21 -05:00

models.js: Don't double-count when map-reducing report series

This commit is contained in:
Aaron Lindsay 2017-02-19 16:52:16 -05:00
parent 6ccf9208f0
commit db7a60b292

View File

@ -451,7 +451,7 @@ Series.prototype.mapReduce = function(mapFn, reduceFn) {
for (var j = 0; j < childValues[0].length; j++) { for (var j = 0; j < childValues[0].length; j++) {
reducedValues.push(childValues.reduce(function(accum, curr, i, arr) { reducedValues.push(childValues.reduce(function(accum, curr, i, arr) {
return reduceFn(accum, arr[i][j]); return reduceFn(accum, arr[i][j]);
}, childValues[0][j])); }, 0));
} }
} }