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 targos committed Jan 14, 2020
1 parent 432e687 commit 5facae0
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 @@ -92,9 +92,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 @@ -912,9 +910,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 5facae0

Please sign in to comment.