GeezerVison is showing github.com — zlib: use for...of · nodejs/node@61da657
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/zlib.js +2-6Lines changed: 2 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -92,9 +92,7 @@ const codes = { |
92 | 92 | Z_VERSION_ERROR: constants.Z_VERSION_ERROR |
93 | 93 | }; |
94 | 94 |
|
95 | | -const ckeys = ObjectKeys(codes); |
96 | | -for (let ck = 0; ck < ckeys.length; ck++) { |
97 | | - const ckey = ckeys[ck]; |
| 95 | +for (const ckey of ObjectKeys(codes)) { |
98 | 96 | codes[codes[ckey]] = ckey; |
99 | 97 | } |
100 | 98 |
|
@@ -912,9 +910,7 @@ ObjectDefineProperties(module.exports, { |
912 | 910 |
|
913 | 911 | // These should be considered deprecated |
914 | 912 | // expose all the zlib constants |
915 | | -const bkeys = ObjectKeys(constants); |
916 | | -for (let bk = 0; bk < bkeys.length; bk++) { |
917 | | - const bkey = bkeys[bk]; |
| 913 | +for (const bkey of ObjectKeys(constants)) { |
918 | 914 | if (bkey.startsWith('BROTLI')) continue; |
919 | 915 | ObjectDefineProperty(module.exports, bkey, { |
920 | 916 | enumerable: false, value: constants[bkey], writable: false |
|