Skip to content

Commit 902ba0e

Browse files
cjihrigtargos
authored andcommitted
src: reduce variable scope in module_wrap.cc
PR-URL: #23297 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Gabriel Schulhof <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 402867c commit 902ba0e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/module_wrap.cc

+7-8
Original file line numberDiff line numberDiff line change
@@ -433,16 +433,15 @@ std::string ReadFile(uv_file file) {
433433
uv_fs_t req;
434434
char buffer_memory[4096];
435435
uv_buf_t buf = uv_buf_init(buffer_memory, sizeof(buffer_memory));
436-
int r;
437436

438437
do {
439-
r = uv_fs_read(uv_default_loop(),
440-
&req,
441-
file,
442-
&buf,
443-
1,
444-
contents.length(), // offset
445-
nullptr);
438+
const int r = uv_fs_read(uv_default_loop(),
439+
&req,
440+
file,
441+
&buf,
442+
1,
443+
contents.length(), // offset
444+
nullptr);
446445
uv_fs_req_cleanup(&req);
447446

448447
if (r <= 0)

0 commit comments

Comments
 (0)