Skip to content

Commit 10f7169

Browse files
trivikrBridgeAR
authored andcommitted
zlib: use for...of
PR-URL: #31051 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 8491e1c commit 10f7169

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/zlib.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ const codes = {
9191
Z_VERSION_ERROR: constants.Z_VERSION_ERROR
9292
};
9393

94-
const ckeys = ObjectKeys(codes);
95-
for (let ck = 0; ck < ckeys.length; ck++) {
96-
const ckey = ckeys[ck];
94+
for (const ckey of ObjectKeys(codes)) {
9795
codes[codes[ckey]] = ckey;
9896
}
9997

@@ -911,9 +909,7 @@ ObjectDefineProperties(module.exports, {
911909

912910
// These should be considered deprecated
913911
// expose all the zlib constants
914-
const bkeys = ObjectKeys(constants);
915-
for (let bk = 0; bk < bkeys.length; bk++) {
916-
const bkey = bkeys[bk];
912+
for (const bkey of ObjectKeys(constants)) {
917913
if (bkey.startsWith('BROTLI')) continue;
918914
ObjectDefineProperty(module.exports, bkey, {
919915
enumerable: false, value: constants[bkey], writable: false

0 commit comments

Comments
 (0)