Skip to content

Commit a502209

Browse files
tniessentargos
authored andcommittedApr 22, 2020
src: refactor to avoid goto in node_file.cc
PR-URL: #32637 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 2c5b014 commit a502209

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed
 

‎src/node_file.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -825,10 +825,8 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo<Value>& args) {
825825

826826
while (p < pe) {
827827
char c = *p++;
828-
if (c == '"') goto quote; // Keeps code flat and inner loop small.
829828
if (c == '\\' && p < pe && *p == '"') p++;
830-
continue;
831-
quote:
829+
if (c != '"') continue;
832830
*ppos++ = p;
833831
if (ppos < &pos[2]) continue;
834832
ppos = &pos[0];

0 commit comments

Comments
 (0)
Please sign in to comment.