Skip to content

Commit

Permalink
zlib: use for...of
Browse files Browse the repository at this point in the history
PR-URL: #31051
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
trivikr authored and Trott committed Dec 31, 2019
1 parent b9f0351 commit 0a958f4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/zlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0a958f4

Please sign in to comment.