From 227bdfe54efff630b037bd41b6272bf37317c015 Mon Sep 17 00:00:00 2001 From: MaleDong Date: Sat, 4 Aug 2018 09:16:22 +0800 Subject: [PATCH] zlib: Remove useless parameters When `checkRangesOrGetDefault` calls `checkFiniteNumber`, the latter function only has two parameters, so `lower` and `upper` don't need to be passed for validation. --- lib/zlib.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/zlib.js b/lib/zlib.js index 4e82c6f2459d6b..ca5f05884ad3c0 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -198,12 +198,12 @@ function checkFiniteNumber(number, name) { throw err; } -// 1. Returns def for undefined and NaN +// 1. Returns def for number when it's undefined or NaN // 2. Returns number for finite numbers >= lower and <= upper // 3. Throws ERR_INVALID_ARG_TYPE for non-numbers // 4. Throws ERR_OUT_OF_RANGE for infinite numbers or numbers > upper or < lower function checkRangesOrGetDefault(number, name, lower, upper, def) { - if (!checkFiniteNumber(number, name, lower, upper)) { + if (!checkFiniteNumber(number, name)) { return def; } if (number < lower || number > upper) {