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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
trivikr authored and BridgeAR committed Jan 3, 2020
1 parent 8491e1c commit 10f7169
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 10f7169

Please sign in to comment.