Skip to content

Commit

Permalink
Don't initialize stats[alias] during decoration but only on first usage
Browse files Browse the repository at this point in the history
Having aliases with no data captured prints empty methods/tables
  • Loading branch information
kidroca committed Aug 4, 2021
1 parent f883ad8 commit d34cbb6
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/decorateWithMetrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ function decorateWithMetrics(func, alias = func.name) {
throw new Error(`"${alias}" is already decorated`);
}

stats[alias] = [];

function decorated(...args) {
const startTime = performance.now() - PERFORMANCE_OFFSET;

Expand Down

0 comments on commit d34cbb6

Please sign in to comment.