Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
src: speed up module loading, skip EOF read
Stop reading from disk when we read fewer bytes than requested because
the next read will be the zero-sized EOF.

PR-URL: #9132
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
bnoordhuis committed Oct 24, 2016
commit 35e8896153b9667b0583812679b3fd72a7470315
2 changes: 0 additions & 2 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,6 @@ static void InternalModuleReadFile(const FunctionCallbackInfo<Value>& args) {
CHECK_GE(numchars, 0);
if (static_cast<size_t>(numchars) < kBlockSize) {
chars.resize(start + numchars);
}
if (numchars == 0) {
break;
}
offset += numchars;
Expand Down