Skip to content

Commit

Permalink
added options to Metrics.create
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Jul 7, 2015
1 parent 2ab20b0 commit 1b7e27d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/Engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ var Engine = {};
engine.metrics = engine.metrics || { extended: false };

// @if DEBUG
engine.metrics = engine.metrics || Metrics.create();
engine.metrics = Metrics.create(engine.metrics);
// @endif

return engine;
Expand Down
6 changes: 4 additions & 2 deletions src/core/Metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ var Metrics = {};
* @private
* @return {metrics} A new metrics
*/
Metrics.create = function() {
return {
Metrics.create = function(options) {
var defaults = {
extended: false,
narrowDetections: 0,
narrowphaseTests: 0,
Expand All @@ -31,6 +31,8 @@ var Metrics = {};
bodies: 0,
pairs: 0
};

return Common.extend(defaults, false, options);
};

/**
Expand Down

0 comments on commit 1b7e27d

Please sign in to comment.