Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 61da657

Browse filesBrowse files
trivikrtargos
authored andcommitted
zlib: use for...of
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>
1 parent 80d7b6e commit 61da657
Copy full SHA for 61da657

File tree

Expand file treeCollapse file tree

1 file changed

+2
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-6
lines changed
Open diff view settings
Collapse file

‎lib/zlib.js‎

Copy file name to clipboardExpand all lines: lib/zlib.js
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ const codes = {
9292
Z_VERSION_ERROR: constants.Z_VERSION_ERROR
9393
};
9494

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)) {
9896
codes[codes[ckey]] = ckey;
9997
}
10098

@@ -912,9 +910,7 @@ ObjectDefineProperties(module.exports, {
912910

913911
// These should be considered deprecated
914912
// 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)) {
918914
if (bkey.startsWith('BROTLI')) continue;
919915
ObjectDefineProperty(module.exports, bkey, {
920916
enumerable: false, value: constants[bkey], writable: false

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.