Skip to content

Commit

Permalink
src: refactor to avoid goto in node_file.cc
Browse files Browse the repository at this point in the history
PR-URL: #32637
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
tniessen authored and BethGriggs committed Apr 14, 2020
1 parent f9e2bae commit 9ed6d84
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -878,10 +878,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

0 comments on commit 9ed6d84

Please sign in to comment.