From b06cf407e814b4b1dd5121bb3405b4c4014be6fd Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 24 Jan 2022 06:39:22 -0800 Subject: [PATCH] util: remove unused fast path in internal debuglog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/41605 Reviewed-By: Anna Henningsen Reviewed-By: Michaƫl Zasso --- lib/internal/util/debuglog.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/internal/util/debuglog.js b/lib/internal/util/debuglog.js index 93c741e753525f..4b5c7cab44ad77 100644 --- a/lib/internal/util/debuglog.js +++ b/lib/internal/util/debuglog.js @@ -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)); @@ -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));