mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
util: remove unused fast path in internal debuglog
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 <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
1 parent
c0ef0d5a66
commit
49ba2104c4
1 file changed
-2
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user