Skip to content

Commit

Permalink
events: fix duplicate require which cause performance penalty
Browse files Browse the repository at this point in the history
  • Loading branch information
targos authored and wwwzbwcom committed Sep 3, 2021
1 parent 31772a4 commit 0f9ffa1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const {
SymbolAsyncIterator,
} = primordials;
const kRejection = SymbolFor('nodejs.rejection');
const { inspect } = require('internal/util/inspect');

let spliceOne;

Expand All @@ -63,10 +64,6 @@ const {
},
} = require('internal/errors');

const {
inspect
} = require('internal/util/inspect');

const {
validateAbortSignal,
validateBoolean,
Expand Down Expand Up @@ -372,7 +369,6 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
}

let stringifiedEr;
const { inspect } = require('internal/util/inspect');
try {
stringifiedEr = inspect(er);
} catch {
Expand Down

0 comments on commit 0f9ffa1

Please sign in to comment.