Skip to content
Closed
Changes from all commits
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
src: refactor to avoid goto in node_file.cc
  • Loading branch information
tniessen committed Apr 3, 2020
commit d2edbf9d5bb3629ac0c5a4aefeb148a94aca34be
4 changes: 1 addition & 3 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -873,10 +873,8 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo<Value>& args) {

while (p < pe) {
char c = *p++;
if (c == '"') goto quote; // Keeps code flat and inner loop small.
if (c == '\\' && p < pe && *p == '"') p++;
continue;
quote:
if (c != '"') continue;
*ppos++ = p;
if (ppos < &pos[2]) continue;
ppos = &pos[0];
Expand Down