Skip to content

Commit 3703195

Browse files
anonrigH4ad
authored andcommitted
fixup! fs: add a fast-path for readFileSync utf-8
Backport-PR-URL: nodejs#48658
1 parent 9cbe99b commit 3703195

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_file.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1928,7 +1928,7 @@ static void ReadFileSync(const FunctionCallbackInfo<Value>& args) {
19281928

19291929
FS_SYNC_TRACE_BEGIN(read);
19301930
while (true) {
1931-
auto r = uv_fs_read(nullptr, &req, file, &buf, 1, result.length(), nullptr);
1931+
auto r = uv_fs_read(nullptr, &req, file, &buf, 1, -1, nullptr);
19321932
if (req.result < 0) {
19331933
FS_SYNC_TRACE_END(read);
19341934
// req will be cleaned up by scope leave.

0 commit comments

Comments
 (0)