From dc29c47ef863373480439fa4bb8e21635aaeb724 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 20 Dec 2019 19:44:33 -0800 Subject: [PATCH] zlib: use for...of --- lib/zlib.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/zlib.js b/lib/zlib.js index b943e1d0b57a01..32bdee0336c42e 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -91,9 +91,7 @@ const codes = { Z_VERSION_ERROR: constants.Z_VERSION_ERROR }; -const ckeys = ObjectKeys(codes); -for (let ck = 0; ck < ckeys.length; ck++) { - const ckey = ckeys[ck]; +for (const ckey of ObjectKeys(codes)) { codes[codes[ckey]] = ckey; } @@ -911,9 +909,7 @@ ObjectDefineProperties(module.exports, { // These should be considered deprecated // expose all the zlib constants -const bkeys = ObjectKeys(constants); -for (let bk = 0; bk < bkeys.length; bk++) { - const bkey = bkeys[bk]; +for (const bkey of ObjectKeys(constants)) { if (bkey.startsWith('BROTLI')) continue; ObjectDefineProperty(module.exports, bkey, { enumerable: false, value: constants[bkey], writable: false