From 499232f0e6dd8baa2c91060b80aa57ed08bb6813 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 24 Apr 2013 21:48:04 -0700 Subject: [PATCH] Use `lodash.reduce` in `getGeometricMean` of perf.js. [ci skip] Former-commit-id: 7c5af9afcd56958e03f96d3f13f396894cf95f4b --- perf/perf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perf/perf.js b/perf/perf.js index abc51a64c..dd27c2ce2 100644 --- a/perf/perf.js +++ b/perf/perf.js @@ -114,7 +114,7 @@ * @returns {Number} The geometric mean. */ function getGeometricMean(array) { - return Math.pow(Math.E, _.reduce(array, function(sum, x) { + return Math.pow(Math.E, lodash.reduce(array, function(sum, x) { return sum + Math.log(x); }, 0) / array.length) || 0; }