Skip to content

Commit

Permalink
util: remove unused fast path in internal debuglog
Browse files Browse the repository at this point in the history
The internal `debuglog()` is never called with 0 parameters. Remove the
fast-path for that situation. If it ever occurs, it will fall through to
the default path.

PR-URL: #41605
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
  • Loading branch information
Trott authored and BethGriggs committed Jan 24, 2022
1 parent 4b174ce commit 2b082de
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/internal/util/debuglog.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ function debuglog(set, cb) {
if (typeof cb === 'function')
cb(debug);
switch (args.length) {
case 0: return debug();
case 1: return debug(args[0]);
case 2: return debug(args[0], args[1]);
default: return debug(...new SafeArrayIterator(args));
Expand All @@ -95,7 +94,6 @@ function debuglog(set, cb) {
};
const logger = (...args) => {
switch (args.length) {
case 0: return debug();
case 1: return debug(args[0]);
case 2: return debug(args[0], args[1]);
default: return debug(...new SafeArrayIterator(args));
Expand Down

0 comments on commit 2b082de

Please sign in to comment.